diff options
author | Martin Odersky <odersky@gmail.com> | 2012-08-17 18:53:25 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-08-20 08:11:10 +0100 |
commit | 5f3e2ce75c1223efc2bbacdb3e546f7d2628880a (patch) | |
tree | 9975fb024bfad69a9c2ade4a1a86b649fd2acc45 /src/compiler/scala/tools/nsc/typechecker/Macros.scala | |
parent | 5978a523149f30b3d31b2ce34ad199eaf253f035 (diff) | |
download | scala-5f3e2ce75c1223efc2bbacdb3e546f7d2628880a.tar.gz scala-5f3e2ce75c1223efc2bbacdb3e546f7d2628880a.tar.bz2 scala-5f3e2ce75c1223efc2bbacdb3e546f7d2628880a.zip |
Made all statistic code disappear unless built with Statistics.canEnable = true
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Macros.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Macros.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index abfefcd31e..dbafd01ebc 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -696,8 +696,8 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { * the expandee with an error marker set if there has been an error */ def macroExpand(typer: Typer, expandee: Tree, mode: Int = EXPRmode, pt: Type = WildcardType): Tree = { - val start = Statistics.startTimer(macroExpandNanos) - Statistics.incCounter(macroExpandCount) + val start = if (Statistics.canEnable) Statistics.startTimer(macroExpandNanos) else null + if (Statistics.canEnable) Statistics.incCounter(macroExpandCount) try { macroExpand1(typer, expandee) match { case Success(expanded) => @@ -725,7 +725,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { result } } finally { - Statistics.stopTimer(macroExpandNanos, start) + if (Statistics.canEnable) Statistics.stopTimer(macroExpandNanos, start) } } |