From 87210b8f1092065be1b7cfaf13a3852fe861abe4 Mon Sep 17 00:00:00 2001 From: paltherr Date: Mon, 18 Aug 2003 15:58:45 +0000 Subject: - rewrote the phase creation process - replace PhaseRepository by CompilerPhases --- sources/scalac/transformer/LambdaLiftPhase.java | 33 +++++++------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'sources/scalac/transformer/LambdaLiftPhase.java') 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) -- cgit v1.2.3