summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/Global.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-01 15:45:42 -0800
committerPaul Phillips <paulp@improving.org>2012-03-01 15:47:37 -0800
commitc5ac8005e23fc533e464d86e2c4ba5a4457844fe (patch)
tree7a0572ea6f712fe3cd1d50b99207e0a42e4277ef /src/compiler/scala/tools/nsc/Global.scala
parent84ab871a18c2a5b2d4dce8c2f42b47f1aada2a09 (diff)
downloadscala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.tar.gz
scala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.tar.bz2
scala-c5ac8005e23fc533e464d86e2c4ba5a4457844fe.zip
Changes to appease the inliner.
It's unfortunate the things one must do to see @inline go through.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/Global.scala21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala
index 1470a43491..1676efef5d 100644
--- a/src/compiler/scala/tools/nsc/Global.scala
+++ b/src/compiler/scala/tools/nsc/Global.scala
@@ -210,22 +210,23 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb
def logError(msg: String, t: Throwable): Unit = ()
- private def atPhaseStackMessage = atPhaseStack match {
- case Nil => ""
- case ps => ps.reverseMap("->" + _).mkString("(", " ", ")")
- }
- private def shouldLogAtThisPhase = (
- (settings.log.isSetByUser)
- && ((settings.log containsPhase globalPhase) || (settings.log containsPhase phase))
- )
-
def logAfterEveryPhase[T](msg: String)(op: => T) {
log("Running operation '%s' after every phase.\n".format(msg) + describeAfterEveryPhase(op))
}
// Over 200 closure objects are eliminated by inlining this.
- @inline final def log(msg: => AnyRef): Unit =
+ @inline final def log(msg: => AnyRef): Unit = {
+ def shouldLogAtThisPhase = (
+ (settings.log.isSetByUser)
+ && ((settings.log containsPhase globalPhase) || (settings.log containsPhase phase))
+ )
+ def atPhaseStackMessage = atPhaseStack match {
+ case Nil => ""
+ case ps => ps.reverseMap("->" + _).mkString("(", " ", ")")
+ }
+
if (shouldLogAtThisPhase)
inform("[log %s%s] %s".format(globalPhase, atPhaseStackMessage, msg))
+ }
@inline final override def debuglog(msg: => String) {
if (settings.debug.value)