Skip to content

Commit 44fd89f

Browse files
committed
Avoid using Enumeration again
1 parent b03551d commit 44fd89f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/profile/Profiler.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ private [profile] class RealProfiler(reporter : ProfileReporter)(implicit ctx: C
190190

191191
}
192192

193-
object EventType extends Enumeration {
194-
type value = Value
193+
case class EventType(name: String)
194+
object EventType {
195195
//main thread with other tasks
196-
val MAIN = Value("main")
196+
val MAIN = EventType("main")
197197
//other task ( background thread)
198-
val BACKGROUND = Value("background")
198+
val BACKGROUND = EventType("background")
199199
//total for compile
200-
val GC = Value("GC")
200+
val GC = EventType("GC")
201201
}
202202

203203
sealed trait ProfileReporter {
@@ -244,7 +244,7 @@ class StreamProfileReporter(out:PrintWriter) extends ProfileReporter {
244244
override def reportForeground(profiler: RealProfiler, threadRange: ProfileRange): Unit = {
245245
reportCommon(EventType.MAIN, profiler, threadRange)
246246
}
247-
private def reportCommon(tpe:EventType.value, profiler: RealProfiler, threadRange: ProfileRange): Unit = {
247+
private def reportCommon(tpe:EventType, profiler: RealProfiler, threadRange: ProfileRange): Unit = {
248248
out.println(s"$tpe,${threadRange.start.snapTimeNanos},${threadRange.end.snapTimeNanos},${profiler.id},${threadRange.phase.id},${threadRange.phase.phaseName.replace(',', ' ')},${threadRange.purpose},${threadRange.taskCount},${threadRange.thread.getId},${threadRange.thread.getName},${threadRange.runNs},${threadRange.idleNs},${threadRange.cpuNs},${threadRange.userNs},${threadRange.allocatedBytes},${threadRange.end.heapBytes} ")
249249
}
250250

0 commit comments

Comments
 (0)