summaryrefslogtreecommitdiff
path: root/sources/scalac/transformer/LambdaLiftPhase.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-08-18 15:58:45 +0000
committerpaltherr <paltherr@epfl.ch>2003-08-18 15:58:45 +0000
commit87210b8f1092065be1b7cfaf13a3852fe861abe4 (patch)
tree0e2ee43a75d151a74cec60e0025876082f2d7bc5 /sources/scalac/transformer/LambdaLiftPhase.java
parentc4e1967d6c99021400b8fa906f51f0bcba984fd4 (diff)
downloadscala-87210b8f1092065be1b7cfaf13a3852fe861abe4.tar.gz
scala-87210b8f1092065be1b7cfaf13a3852fe861abe4.tar.bz2
scala-87210b8f1092065be1b7cfaf13a3852fe861abe4.zip
- rewrote the phase creation process
- replace PhaseRepository by CompilerPhases
Diffstat (limited to 'sources/scalac/transformer/LambdaLiftPhase.java')
-rw-r--r--sources/scalac/transformer/LambdaLiftPhase.java33
1 files changed, 9 insertions, 24 deletions
diff --git a/sources/scalac/transformer/LambdaLiftPhase.java b/sources/scalac/transformer/LambdaLiftPhase.java
index a891aa0dc7..e2181c5ccf 100644
--- a/sources/scalac/transformer/LambdaLiftPhase.java
+++ b/sources/scalac/transformer/LambdaLiftPhase.java
@@ -15,37 +15,22 @@ import scalac.symtab.*;
import scalac.checkers.*;
import java.util.ArrayList;
-public class LambdaLiftPhase extends PhaseDescriptor implements Kinds, Modifiers {
+public class LambdaLiftPhase extends Phase implements Kinds, Modifiers {
- private Global global;
- int nextPhase;
+ final int nextPhase;
- public void initialize(Global global, int id) {
- super.initialize(global, id);
- this.global = global;
+ /** Initializes this instance. */
+ public LambdaLiftPhase(Global global, PhaseDescriptor descriptor) {
+ super(global, descriptor);
this.nextPhase = id + 1;
}
- public String name () {
- return "lambdalift";
+ /** Applies this phase to the given compilation units. */
+ public void apply(Unit[] units) {
+ for (int i = 0; i < units.length; i++)
+ new LambdaLift(global, this).apply(units[i]);
}
- public String description () {
- return "lambda lifter";
- }
-
- public String taskDescription() {
- return "lambda lifting";
- }
-
- public void apply(Global global) {
- new LambdaLift(global, this).apply();
- }
-
- public void apply(Unit unit) {
- new LambdaLift(unit.global, this).apply(unit);
- }
-
public Type transformInfo(Symbol sym, Type tp) {
/*
if (global.debug)