summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-01-25 09:52:05 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2016-01-25 10:10:24 +0100
commit3dccf0ee22303e1c192ed3e40391df48d811f3f6 (patch)
tree6340addb2c5fcbf661a2fabaeffc245e1edd128d /src
parentb0831e774e290148ce28cb7957794542dffe0366 (diff)
downloadscala-3dccf0ee22303e1c192ed3e40391df48d811f3f6.tar.gz
scala-3dccf0ee22303e1c192ed3e40391df48d811f3f6.tar.bz2
scala-3dccf0ee22303e1c192ed3e40391df48d811f3f6.zip
-YoptTrace takes a package/Class.method parameter
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala3
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala
index 7a1dcd9ec6..c1fdb7eb59 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala
@@ -230,7 +230,8 @@ class LocalOpt[BT <: BTypes](val btypes: BT) {
// for local variables in dead blocks. Maybe that's a bug in the ASM framework.
var currentTrace: String = null
- def traceIfChanged(optName: String): Unit = if (compilerSettings.YoptTrace.value) {
+ val doTrace = compilerSettings.YoptTrace.isSetByUser && compilerSettings.YoptTrace.value == ownerClassName + "." + method.name
+ def traceIfChanged(optName: String): Unit = if (doTrace) {
val after = AsmUtils.textify(method)
if (currentTrace != after) {
println(s"after $optName")
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index d6ca0125ea..20e2c4346f 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -319,7 +319,7 @@ trait ScalaSettings extends AbsScalaSettings
def YoptWarningNoInlineMissingBytecode = YoptWarnings.contains(YoptWarningsChoices.noInlineMissingBytecode)
def YoptWarningNoInlineMissingScalaInlineInfoAttr = YoptWarnings.contains(YoptWarningsChoices.noInlineMissingScalaInlineInfoAttr)
- val YoptTrace = BooleanSetting("-YoptTrace", "trace optimizer progress")
+ val YoptTrace = StringSetting("-YoptTrace", "package/Class.method", "Trace the optimizer progress for a specific method.", "")
private def removalIn212 = "This flag is scheduled for removal in 2.12. If you have a case where you need this flag then please report a bug."