diff options
author | Martin Odersky <odersky@gmail.com> | 2011-09-30 16:47:34 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-09-30 16:47:34 +0000 |
commit | b939e8fbaba0bcbf3fc92bd8e915e2641b7e4ddf (patch) | |
tree | 0bcf076e3b078b30e8a765605b869d5396d56a9a /src/compiler/scala/tools/nsc/Global.scala | |
parent | a2e9a1b465c9e9baeabfbea2474ab63fa57e5100 (diff) | |
download | scala-b939e8fbaba0bcbf3fc92bd8e915e2641b7e4ddf.tar.gz scala-b939e8fbaba0bcbf3fc92bd8e915e2641b7e4ddf.tar.bz2 scala-b939e8fbaba0bcbf3fc92bd8e915e2641b7e4ddf.zip |
First untested attempt to create a runtime comp...
First untested attempt to create a runtime compiler. Review by
extempore.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index ca50979e9c..604379d33f 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -997,24 +997,24 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb return } - val startTime = currentTime - reporter.reset(); - { - val first :: rest = sources - val unit = new CompilationUnit(first) - addUnit(unit) - checkDeprecatedSettings(unit) - - for (source <- rest) - addUnit(new CompilationUnit(source)) - } - globalPhase = firstPhase + compileUnits(sources map (new CompilationUnit(_)), firstPhase) + } + /** Compile list of units, starting with phase `fromPhase` + */ + def compileUnits(units: List[CompilationUnit], fromPhase: Phase) { + units foreach addUnit if (opt.profileAll) { inform("starting CPU profiling on compilation run") profiler.startProfiling() } - while (globalPhase != terminalPhase && !reporter.hasErrors) { + val startTime = currentTime + + reporter.reset() + checkDeprecatedSettings(unitbuf.head) + globalPhase = firstPhase + + while (globalPhase != terminalPhase && !reporter.hasErrors) { val startTime = currentTime phase = globalPhase |