Skip to content

Commit d737f6a

Browse files
committed
Some more tweaks
1 parent 6d5ee74 commit d737f6a

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala

+5-3
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,13 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
567567

568568
def foreachTypeVar(op: TypeVar => Unit): Unit =
569569
boundsMap.foreachBinding { (poly, entries) =>
570-
for (i <- 0 until paramCount(entries))
571-
typeVar(entries, i) match {
570+
var i = 0
571+
val limit = paramCount(entries)
572+
while i < limit do
573+
typeVar(entries, i) match
572574
case tv: TypeVar if !tv.inst.exists => op(tv)
573575
case _ =>
574-
}
576+
i += 1
575577
}
576578

577579
private var myUninstVars: mutable.ArrayBuffer[TypeVar] = _

compiler/src/dotty/tools/dotc/transform/Instrumentation.scala

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ class Instrumentation extends MiniPhase { thisPhase =>
2828
ctx.settings.YinstrumentClosures.value ||
2929
ctx.settings.YinstrumentAllocations.value
3030

31-
private val namesOfInterest = List("::", "+=", "toString")
31+
private val namesOfInterest = List(
32+
"::", "+=", "toString",
33+
"map", "flatMap", "filter", "withFilter", "collect", "foldLeft", "foldRight", "take",
34+
"reverse", "mapConserve", "mapconserve", "filterConserve", "zip")
3235
private var namesToRecord: Set[Name] = _
3336

3437
private var consName: TermName = _
@@ -47,7 +50,7 @@ class Instrumentation extends MiniPhase { thisPhase =>
4750
case Select(nu: New, _) =>
4851
cpy.Block(tree)(record(i"alloc/${nu.tpe}", tree) :: Nil, tree)
4952
case Select(_, name) if namesToRecord.contains(name) =>
50-
cpy.Block(tree)(record(i"alloc/$name", tree) :: Nil, tree)
53+
cpy.Block(tree)(record(i"call/$name", tree) :: Nil, tree)
5154
case _ =>
5255
tree
5356
}

0 commit comments

Comments
 (0)