diff options
author | Paul Phillips <paulp@improving.org> | 2010-10-29 00:00:05 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-10-29 00:00:05 +0000 |
commit | b4afd4c86b1eb76b03acb706a34979532fd08c8d (patch) | |
tree | f200ecd5299db7d953776d94c8716f128f1c3b07 /src/compiler/scala/tools/nsc/Global.scala | |
parent | 460edf36cb9e19ceea58dcce0cc4c9d6c5b234ac (diff) | |
download | scala-b4afd4c86b1eb76b03acb706a34979532fd08c8d.tar.gz scala-b4afd4c86b1eb76b03acb706a34979532fd08c8d.tar.bz2 scala-b4afd4c86b1eb76b03acb706a34979532fd08c8d.zip |
Some deletions in global based on adriaan's goo...
Some deletions in global based on adriaan's good advice. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 288817ec1c..2f9b63eead 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -324,10 +324,6 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable val runsRightAfter = None } with RefChecks -// object devirtualize extends { -// val global: Global.this.type = Global.this -// } with DeVirtualize - // phaseName = "liftcode" object liftcode extends { val global: Global.this.type = Global.this @@ -385,13 +381,6 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable val runsRightAfter = None } with LambdaLift - // phaseName = "detach" -// object detach extends { -// val global: Global.this.type = Global.this -// val runsAfter = List("lambdalift") -// val runsRightAfter = Some("lambdalift") -// } with Detach - // phaseName = "constructors" object constructors extends { val global: Global.this.type = Global.this @@ -427,10 +416,6 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable val runsRightAfter = None } with GenICode -// object icodePrinter extends backend.icode.Printers { -// val global: Global.this.type = Global.this -// } - // phaseName = "???" object scalaPrimitives extends { val global: Global.this.type = Global.this @@ -529,13 +514,9 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable phasesSet += analyzer.namerFactory // note: types are there because otherwise phasesSet += analyzer.packageObjects // consistency check after refchecks would fail. phasesSet += analyzer.typerFactory - phasesSet += superAccessors // add super accessors - phasesSet += pickler // serialize symbol tables - phasesSet += refchecks // perform reference and override checking, translate nested objects - -// if (false && settings.YvirtClasses) -// phasesSet += devirtualize // Desugar virtual classes4 - + phasesSet += superAccessors // add super accessors + phasesSet += pickler // serialize symbol tables + phasesSet += refchecks // perform reference and override checking, translate nested objects phasesSet += uncurry // uncurry, translate function values to anonymous classes phasesSet += tailCalls // replace tail calls by jumps phasesSet += specializeTypes @@ -543,9 +524,6 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable phasesSet += erasure // erase types, add interfaces for traits phasesSet += lazyVals phasesSet += lambdaLift // move nested functions to top level - // if (forJVM && settings.Xdetach.value) - // phasesSet += detach // convert detached closures - phasesSet += constructors // move field definitions into constructors phasesSet += mixer // do mixin composition phasesSet += cleanup // some platform-specific cleanups @@ -751,9 +729,8 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable def compileSources(_sources: List[SourceFile]) { val depSources = dependencyAnalysis.filter(_sources.distinct) // bug #1268, scalac confused by duplicated filenames val sources = coreClassesFirst(depSources) - if (reporter.hasErrors) - return // there is a problem already, e.g. a - // plugin was passed a bad option + if (reporter.hasErrors) // there is a problem already, e.g. a plugin was passed a bad option + return val startTime = currentTime reporter.reset for (source <- sources) addUnit(new CompilationUnit(source)) @@ -799,8 +776,8 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable sym.reset(new loaders.SourcefileLoader(file)) if (sym.isTerm) sym.moduleClass.reset(loaders.moduleClassLoader) } - } else { - //assert(symData.isEmpty || !settings.stop.value.isEmpty || !settings.skip.value.isEmpty, symData) + } + else { if (deprecationWarnings) { warning("there were deprecation warnings; re-run with " + settings.deprecation.name + " for details") } @@ -808,7 +785,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable warning("there were unchecked warnings; re-run with " + settings.unchecked.name + " for details") } } - for ((sym, file) <- symSource.iterator) resetPackageClass(sym.owner) + symSource.keys foreach (x => resetPackageClass(x.owner)) informTime("total", startTime) if (!dependencyAnalysis.off) { @@ -852,11 +829,11 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable */ def compileLate(file: AbstractFile) { if (compiledFiles eq null) { - val msg = "No class file for " + file + - " was found\n(This file cannot be loaded as a source file)" + val msg = "No class file for " + file + " was found\n(This file cannot be loaded as a source file)" inform(msg) throw new FatalError(msg) - } else if (!(compiledFiles contains file.path)) { + } + else if (!(compiledFiles contains file.path)) { compileLate(new CompilationUnit(getSourceFile(file))) } } @@ -943,9 +920,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable def printAllUnits() { print("[[syntax trees at end of " + phase + "]]") - atPhase(phase.next) { - for (unit <- currentRun.units) treePrinter.print(unit) - } + atPhase(phase.next) { currentRun.units foreach (treePrinter print _) } } def showDef(name: Name, module: Boolean) { |