From 49a878d4f8ba1d688f6f8a0ea23275b14bffca95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9?= Date: Mon, 30 Mar 2020 18:05:41 +0200 Subject: [PATCH] fixup! Use NQP prefix for finding profiler template --- src/vm/moar/HLL/Backend.nqp | 11 +++++++++-- tools/lib/NQP/Config/NQP.pm | 8 -------- tools/templates/Makefile-common.in | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/vm/moar/HLL/Backend.nqp b/src/vm/moar/HLL/Backend.nqp index 7cbeee2b22..87991c6864 100644 --- a/src/vm/moar/HLL/Backend.nqp +++ b/src/vm/moar/HLL/Backend.nqp @@ -14,6 +14,11 @@ my sub literal_subst(str $source, str $pattern, $replacement) { class HLL::Backend::MoarVM { our %moar_config := nqp::backendconfig(); + has %!compiler_config; + + method BUILD(:%compiler_config!) { + } + my sub read_ui32($fh, $buf?) { unless $buf { $buf := nqp::create($NQPBuf) } nqp::readfh($fh, $buf, 4); @@ -691,7 +696,7 @@ class HLL::Backend::MoarVM { my str $template; if !$want_json && !$want_sql { - my $temppath := nqpconfig() ~ '/share/nqp/lib/profiler/template.html'; + my $temppath := %!compiler_config ~ '/profiler/template.html'; $template := try slurp('src/vm/moar/profiler/template.html'); unless $template { $template := try slurp($temppath); @@ -801,5 +806,7 @@ class HLL::Backend::MoarVM { # Role specifying the default backend for this build. role HLL::Backend::Default { - method default_backend() { HLL::Backend::MoarVM } + method default_backend() { + HLL::Backend::MoarVM.new(:compiler_config(self.config)); + } } diff --git a/tools/lib/NQP/Config/NQP.pm b/tools/lib/NQP/Config/NQP.pm index fbf03825cd..1c1a59d4b0 100644 --- a/tools/lib/NQP/Config/NQP.pm +++ b/tools/lib/NQP/Config/NQP.pm @@ -93,14 +93,6 @@ sub configure_misc { $config->{moar_stage0} = $self->nfp( "src/vm/moar/stage0", no_quote => 1 ); $config->{jvm_stage0} = $self->nfp( "src/vm/jvm/stage0", no_quote => 1 ); - - # TODO: Use the template infrastructure from nqp-configure? - open my $configfile, '>', 'src/core/Config.nqp'; - print $configfile "# This file is generated automatically by $0\n"; - print $configfile "sub nqpconfig() {\n"; - print $configfile " nqp::hash('prefix', '$config->{prefix}');\n"; - print $configfile "}\n"; - close $configfile; } sub configure_moar_backend { diff --git a/tools/templates/Makefile-common.in b/tools/templates/Makefile-common.in index 44a02d0ca9..93377f7680 100644 --- a/tools/templates/Makefile-common.in +++ b/tools/templates/Makefile-common.in @@ -12,7 +12,6 @@ COMMON_HLL_SOURCES = \ HLL_COMBINED = NQPHLL.nqp CORE_SETTING_SOURCES = \ - @nfp(src/core/Config.nqp)@ \ @nfp(src/core/NativeTypes.nqp)@ \ @nfp(src/core/NQPRoutine.nqp)@ \ @nfp(src/core/NQPMu.nqp)@ \