@@ -438,8 +438,10 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
438
438
currentRun.informUnitStarting(this , unit)
439
439
val unit0 = currentUnit
440
440
currentRun.currentUnit = unit
441
+ currentRun.profiler.beforeUnit(phase, unit.source.file)
441
442
try apply(unit)
442
443
finally {
444
+ currentRun.profiler.afterUnit(phase, unit.source.file)
443
445
currentRun.currentUnit = unit0
444
446
currentRun.advanceUnit()
445
447
}
@@ -1100,6 +1102,9 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
1100
1102
1101
1103
def newJavaUnitParser (unit : CompilationUnit ): JavaUnitParser = new JavaUnitParser (unit)
1102
1104
1105
+ override protected [scala] def currentRunProfilerBeforeCompletion (root : Symbol , associatedFile : AbstractFile ): Unit = currentRun.profiler.beforeCompletion(root, associatedFile)
1106
+ override protected [scala] def currentRunProfilerAfterCompletion (root : Symbol , associatedFile : AbstractFile ): Unit = currentRun.profiler.afterCompletion(root, associatedFile)
1107
+
1103
1108
/** A Run is a single execution of the compiler on a set of units.
1104
1109
*/
1105
1110
class Run extends RunContextApi with RunReporting with RunParsing {
@@ -1448,7 +1453,7 @@ class Global(var currentSettings: Settings, reporter0: Reporter)
1448
1453
private final val GlobalPhaseName = " global (synthetic)"
1449
1454
protected final val totalCompileTime = statistics.newTimer(" #total compile time" , GlobalPhaseName )
1450
1455
1451
- def compileUnits (units : List [CompilationUnit ], fromPhase : Phase ): Unit = compileUnitsInternal(units,fromPhase)
1456
+ def compileUnits (units : List [CompilationUnit ], fromPhase : Phase ): Unit = compileUnitsInternal(units,fromPhase)
1452
1457
private def compileUnitsInternal (units : List [CompilationUnit ], fromPhase : Phase ) {
1453
1458
units foreach addUnit
1454
1459
reporter.reset()
0 commit comments