Skip to content

Commit

Permalink
fixup! Use NQP prefix for finding profiler template
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloé committed Mar 30, 2020
1 parent a7806d5 commit 49a878d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
11 changes: 9 additions & 2 deletions src/vm/moar/HLL/Backend.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -691,7 +696,7 @@ class HLL::Backend::MoarVM {
my str $template;

if !$want_json && !$want_sql {
my $temppath := nqpconfig()<prefix> ~ '/share/nqp/lib/profiler/template.html';
my $temppath := %!compiler_config<libdir> ~ '/profiler/template.html';
$template := try slurp('src/vm/moar/profiler/template.html');
unless $template {
$template := try slurp($temppath);
Expand Down Expand Up @@ -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));
}
}
8 changes: 0 additions & 8 deletions tools/lib/NQP/Config/NQP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion tools/templates/Makefile-common.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)@ \
Expand Down

0 comments on commit 49a878d

Please sign in to comment.