@@ -28,7 +28,10 @@ class Instrumentation extends MiniPhase { thisPhase =>
28
28
ctx.settings.YinstrumentClosures .value ||
29
29
ctx.settings.YinstrumentAllocations .value
30
30
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" )
32
35
private var namesToRecord : Set [Name ] = _
33
36
34
37
private var consName : TermName = _
@@ -46,8 +49,8 @@ class Instrumentation extends MiniPhase { thisPhase =>
46
49
override def transformApply (tree : Apply )(using Context ): Tree = tree.fun match {
47
50
case Select (nu : New , _) =>
48
51
cpy.Block (tree)(record(i " alloc/ ${nu.tpe}" , tree) :: Nil , tree)
49
- case Select (_, name) if namesToRecord.contains(name) =>
50
- cpy.Block (tree)(record(i " alloc/ $ name" , tree) :: Nil , tree)
52
+ case ref : RefTree if namesToRecord.contains(ref. name) =>
53
+ cpy.Block (tree)(record(i " call/ ${ref. name} " , tree) :: Nil , tree)
51
54
case _ =>
52
55
tree
53
56
}
0 commit comments