Permalink
Browse files

Add Tree::Optimizer.pass-class method.

  • Loading branch information...
1 parent f253b31 commit 2cc3e32c73199dfa9adaaccd261a256ec8836691 tcurtis committed Aug 8, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/Tree/Optimizer.nqp
View
8 src/Tree/Optimizer.nqp
@@ -32,9 +32,13 @@ method find-pass ($name) {
%!passes{$name};
}
+method pass-class () {
+ Tree::Optimizer::Pass;
+}
+
method register ($transformation, *%adverbs) {
my $pass;
- if $transformation ~~ Tree::Optimizer::Pass {
+ if $transformation ~~ self.pass-class {
$pass := $transformation.clone;
if pir::exists__IQs(%adverbs, 'depends-on') {
if pir::isa__IPP(%adverbs<depends-on>, String) {
@@ -45,7 +49,7 @@ method register ($transformation, *%adverbs) {
}
$pass.name(%adverbs<name>) if pir::exists__IQs(%adverbs, 'name');
} else {
- $pass := Tree::Optimizer::Pass.new($transformation, |%adverbs);
+ $pass := self.pass-class.new($transformation, |%adverbs);
}
%!passes{$pass.name} := $pass;
for $pass.dependencies -> $dependency {

0 comments on commit 2cc3e32

Please sign in to comment.