diff options
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/tools/scalac/wholeprog/WholeProgPhase.scala | 5 | ||||
-rw-r--r-- | sources/scala/tools/scaladoc/ScalaSearch.java | 4 | ||||
-rw-r--r-- | sources/scalac/Global.java | 6 | ||||
-rw-r--r-- | sources/scalac/Phase.java | 5 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sources/scala/tools/scalac/wholeprog/WholeProgPhase.scala b/sources/scala/tools/scalac/wholeprog/WholeProgPhase.scala index b032b59a21..4666b577a1 100644 --- a/sources/scala/tools/scalac/wholeprog/WholeProgPhase.scala +++ b/sources/scala/tools/scalac/wholeprog/WholeProgPhase.scala @@ -31,7 +31,7 @@ class WholeProgPhase(global: scalac_Global, descriptor: PhaseDescriptor) /* Apply the global analysis phase to the given units */ - override def apply(units: Array[CompilationUnit]): unit = { + def applyAll(units: Array[CompilationUnit]): unit = { if (!global.args.XdotFile.value.equals("$")) { val dotFilePrinter = new PrintDotFile(units); @@ -50,7 +50,8 @@ class WholeProgPhase(global: scalac_Global, descriptor: PhaseDescriptor) } } - override def apply(unit: CompilationUnit): Unit = throw Debug.abort("!!!"); + override def apply(unit: CompilationUnit): Unit = + throw Debug.abort("!!! Phase " + this + " is currently disabled"); } diff --git a/sources/scala/tools/scaladoc/ScalaSearch.java b/sources/scala/tools/scaladoc/ScalaSearch.java index ec1a8811e4..1a2e741c7c 100644 --- a/sources/scala/tools/scaladoc/ScalaSearch.java +++ b/sources/scala/tools/scaladoc/ScalaSearch.java @@ -552,7 +552,9 @@ public class ScalaSearch { CompilationUnit tmpUnit = new CompilationUnit(global, sourceFile, false); tmpUnit.body = new Parser$class(tmpUnit).parse(); - global.PHASE.ANALYZER.phase().apply(new CompilationUnit[]{ tmpUnit }); + global.PHASE.ANALYZER.phase().apply(tmpUnit); + ((scalac.typechecker.AnalyzerPhase)global.PHASE.ANALYZER.phase()) + .getUnits(); // force completion of type analysis if (global.reporter.errors() == errorNumber) { Scope tmpScope = tmpUnit.body[0].symbol().members(); Type res = tmpScope.lookup(Name.fromString("f")).type(); diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index 141d6ec140..dcf8d182fd 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -270,6 +270,7 @@ public abstract class Global { } this.make = new DefaultTreeFactory(); this.PHASE = args.phases; + args.phases.WHOLEPROG.addSkipFlag(); // !!! // if (!optimize) PHASE.remove(args.phases.OPTIMIZE); // TODO: Enable TailCall for other backends when they handle LabelDefs if (!runTimeTypes) args.phases.TYPESASVALUES.addSkipFlag(); @@ -381,7 +382,8 @@ public abstract class Global { currentPhase = currentPhase.next; start(); // System.out.println("*** " + currentPhase.descriptor.description() + " ***"); - currentPhase.apply(units); + for (int i = 0; i < units.length; i++) + currentPhase.apply(units[i]); if (currentPhase == PHASE.ANALYZER.phase()) units = ((AnalyzerPhase)currentPhase).getUnits(); stop(currentPhase.descriptor.taskDescription()); @@ -413,7 +415,7 @@ public abstract class Global { Phase backup = currentPhase; // !!! add code to print/skip/graph as in compile currentPhase = PHASE.PARSER.phase(); - PHASE.PARSER.phase().apply(new CompilationUnit[] {unit}); + PHASE.PARSER.phase().apply(unit); currentPhase = PHASE.ANALYZER.phase(); ((AnalyzerPhase)PHASE.ANALYZER.phase()).apply(unit); // !!! add code for later phases? diff --git a/sources/scalac/Phase.java b/sources/scalac/Phase.java index 88420302e9..5239562e9d 100644 --- a/sources/scalac/Phase.java +++ b/sources/scalac/Phase.java @@ -61,11 +61,6 @@ public abstract class Phase { return tp; } - /** Applies this phase to the given compilation units. */ - public void apply(CompilationUnit[] units) { - for (int i = 0; i < units.length; i++) apply(units[i]); - } - /** Applies this phase to the given compilation unit. */ public abstract void apply(CompilationUnit unit); |