Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate QAST::BlockMemo, now nqpattr is gone.
It was always just a hack to provide for nqpattr, and has no other
purpose.
  • Loading branch information
jnthn committed Oct 21, 2012
1 parent 94ff05c commit 903ce78
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 72 deletions.
25 changes: 0 additions & 25 deletions src/QAST/BlockMemo.nqp

This file was deleted.

47 changes: 1 addition & 46 deletions src/QAST/Compiler.nqp
Expand Up @@ -573,52 +573,7 @@ class QAST::Compiler is HLL::Compiler {
}
$ops
}

multi method as_post(QAST::BlockMemo $node, :$want) {
# Build the POST::Sub.
my $sub;
{
# Block gets completely fresh registers, and fresh BlockInfo.
my $*REGALLOC := RegAlloc.new();
my $*BLOCKRA := $*REGALLOC;
my $*BINDVAL := 0;
my $block := BlockInfo.new($node, 0);

# First need to compile all of the statements. Fake NQP HLL.
my $stmts;
{
my $*BLOCK := $block;
my $*HLL := 'nqp';
my $*WANT;
$stmts := self.compile_all_the_stmts($node.list);
}

# Generate declarations.
my $decls := PIRT::Ops.new();
for $block.lexicals {
$decls.push_pirop('.lex ' ~ self.escape($_.name) ~ ', ' ~ $block.lex_reg($_.name));
}
for $block.locals {
$decls.push_pirop('.local ' ~ $block.local_type_long($_.name) ~ ' ' ~ $_.name);
}

# Wrap all up in a POST::Sub.
$sub := PIRT::Sub.new();
$sub.push($decls);
$sub.push($stmts);
$sub.push_pirop(".return (" ~ $stmts.result ~ ")");

# Set compilation unit ID, namespace (forced to Sub) and
# HLL (forced to NQP).
$sub.name($node.name);
$sub.subid($node.cuid);
$sub.namespace(['Sub']);
$sub.hll('nqp');
}

return $sub;
}


multi method as_post(QAST::Stmts $node, :$want) {
self.compile_all_the_stmts($node.list, $node.resultchild, :node($node.node))
}
Expand Down
1 change: 0 additions & 1 deletion tools/build/Makefile.in
Expand Up @@ -85,7 +85,6 @@ QASTNODE_SOURCES = \
src/QAST/Stmts.nqp \
src/QAST/Stmt.nqp \
src/QAST/Block.nqp \
src/QAST/BlockMemo.nqp \
src/QAST/Unquote.nqp \
src/QAST/CompUnit.nqp \
src/QAST/InlinePlaceholder.nqp \
Expand Down

0 comments on commit 903ce78

Please sign in to comment.