File tree 2 files changed +8
-4
lines changed
compiler/src/dotty/tools/dotc
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -151,8 +151,10 @@ class Compiler {
151
151
List (new GenBCode ) :: // Generate JVM bytecode
152
152
Nil
153
153
154
- // Initially 0, so that the first nextRunId call would return InitialRunId == 1
155
- private var runId : Int = 0
154
+ // TODO: Initially 0, so that the first nextRunId call would return InitialRunId == 1
155
+ // Changing the initial runId from 1 to 0 makes the scala2-library-bootstrap fail to compile,
156
+ // when the underlying issue is fixed, please update dotc.profiler.RealProfiler.chromeTrace logic
157
+ private var runId : Int = 1
156
158
def nextRunId : Int = {
157
159
runId += 1 ; runId
158
160
}
Original file line number Diff line number Diff line change @@ -185,10 +185,12 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(using Context)
185
185
// Compilation units requiring multi-stage compilation (macros) would create a new profiler instances
186
186
// We need to store the traces in the seperate file to prevent overriding its content.
187
187
// Alternatives: sharing ChromeTrace instance between all runs / manual concatation after all runs are done
188
- val suffix = if ctx.runId > InitialRunId then s " . ${ctx.runId}" else " "
188
+ // FIXME: The first assigned runId is equal to 2 instead of 1 (InitialRunId).
189
+ // Fix me when bug described in Compiler.runId is resolved by removing +/- 1 adjustments
190
+ val suffix = if ctx.runId > InitialRunId + 1 then s " . ${ctx.runId - 1 }" else " "
189
191
ChromeTrace (Paths .get(s " $filename$suffix" ))
190
192
191
- private val compilerRunEvent : TracedEventId = traceDurationStart(Category .Run , s " stage- ${ctx.runId} " )
193
+ private val compilerRunEvent : TracedEventId = traceDurationStart(Category .Run , s " scalac- $id " )
192
194
193
195
def completeBackground (threadRange : ProfileRange ): Unit =
194
196
reporter.reportBackground(this , threadRange)
You can’t perform that action at this time.
0 commit comments