summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-23 22:50:46 +0000
committerPaul Phillips <paulp@improving.org>2011-07-23 22:50:46 +0000
commitc3c1c65d5fa2a6fd94e8f3bda7c5b4b5408bb789 (patch)
tree59302a13061022c78058c65d41774bb94983f8d9 /src/compiler/scala/reflect/internal
parent5c61410fe5b8fd636bde6484f04a2d1160ed7eb4 (diff)
downloadscala-c3c1c65d5fa2a6fd94e8f3bda7c5b4b5408bb789.tar.gz
scala-c3c1c65d5fa2a6fd94e8f3bda7c5b4b5408bb789.tar.bz2
scala-c3c1c65d5fa2a6fd94e8f3bda7c5b4b5408bb789.zip
Since trunk seems to be undergoing all kinds of...
Since trunk seems to be undergoing all kinds of changes of the sort which touch lots of files, the time is ripe for various search/replace improvements which have stacked up. This one is the replacement of all "if (settings.debug.value) log" with "debuglog" since as noted in a recent commit, the inliner will take care of that for you. No review.
Diffstat (limited to 'src/compiler/scala/reflect/internal')
-rw-r--r--src/compiler/scala/reflect/internal/SymbolTable.scala4
-rw-r--r--src/compiler/scala/reflect/internal/TreeGen.scala2
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala18
3 files changed, 12 insertions, 12 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala
index 81c4cef4d4..9e59c1d509 100644
--- a/src/compiler/scala/reflect/internal/SymbolTable.scala
+++ b/src/compiler/scala/reflect/internal/SymbolTable.scala
@@ -32,6 +32,9 @@ abstract class SymbolTable extends api.Universe
def abort(msg: String): Nothing = throw new Error(msg)
def abort(): Nothing = throw new Error()
+ /** Override with final implementation for inlining. */
+ def debuglog(msg: => String): Unit = if (settings.debug.value) log(msg)
+
/** Are we compiling for Java SE? */
// def forJVM: Boolean
@@ -119,7 +122,6 @@ abstract class SymbolTable extends api.Universe
import scala.tools.util.Signallable
import scala.runtime.ScalaRunTime.stringOf
-
// We can allow ourselves a structural type, these methods
// amount to a few calls per run at most. This does suggest
// a "Clearable" trait may be useful.
diff --git a/src/compiler/scala/reflect/internal/TreeGen.scala b/src/compiler/scala/reflect/internal/TreeGen.scala
index c17ab8be63..f184bcee51 100644
--- a/src/compiler/scala/reflect/internal/TreeGen.scala
+++ b/src/compiler/scala/reflect/internal/TreeGen.scala
@@ -150,7 +150,7 @@ abstract class TreeGen {
/** Cast `tree` to type `pt` */
def mkCast(tree: Tree, pt: Type): Tree = {
- if (settings.debug.value) log("casting " + tree + ":" + tree.tpe + " to " + pt)
+ debuglog("casting " + tree + ":" + tree.tpe + " to " + pt)
assert(!tree.tpe.isInstanceOf[MethodType], tree)
assert(!pt.typeSymbol.isPackageClass)
assert(!pt.typeSymbol.isPackageObjectClass)
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala
index 358258390f..2c626013b3 100644
--- a/src/compiler/scala/reflect/internal/Types.scala
+++ b/src/compiler/scala/reflect/internal/Types.scala
@@ -4034,14 +4034,13 @@ A type's typeSymbol should never be inspected directly.
def corresponds(sym1: Symbol, sym2: Symbol): Boolean =
sym1.name == sym2.name && (sym1.isPackageClass || corresponds(sym1.owner, sym2.owner))
if (!corresponds(sym.owner, rebind0.owner)) {
- if (settings.debug.value)
- log("ADAPT1 pre = "+pre+", sym = "+sym+sym.locationString+", rebind = "+rebind0+rebind0.locationString)
+ debuglog("ADAPT1 pre = "+pre+", sym = "+sym+sym.locationString+", rebind = "+rebind0+rebind0.locationString)
val bcs = pre.baseClasses.dropWhile(bc => !corresponds(bc, sym.owner));
if (bcs.isEmpty)
assert(pre.typeSymbol.isRefinementClass, pre) // if pre is a refinementclass it might be a structural type => OK to leave it in.
else
rebind0 = pre.baseType(bcs.head).member(sym.name)
- if (settings.debug.value) log(
+ debuglog(
"ADAPT2 pre = " + pre +
", bcs.head = " + bcs.head +
", sym = " + sym+sym.locationString +
@@ -4053,7 +4052,7 @@ A type's typeSymbol should never be inspected directly.
}
val rebind = rebind0.suchThat(sym => sym.isType || sym.isStable)
if (rebind == NoSymbol) {
- if (settings.debug.value) log("" + phase + " " +phase.flatClasses+sym.owner+sym.name+" "+sym.isType)
+ debuglog("" + phase + " " +phase.flatClasses+sym.owner+sym.name+" "+sym.isType)
throw new MalformedType(pre, sym.nameString)
}
rebind
@@ -5684,7 +5683,7 @@ A type's typeSymbol should never be inspected directly.
* of types.
*/
private def commonOwner(tps: List[Type]): Symbol = {
- // if (settings.debug.value) log("computing common owner of types " + tps)//DEBUG
+ // debuglog("computing common owner of types " + tps)//DEBUG
commonOwnerMap.init
tps foreach { tp => commonOwnerMap.apply(tp); () }
commonOwnerMap.result
@@ -5748,7 +5747,7 @@ A type's typeSymbol should never be inspected directly.
case ex: MalformedType => None
case ex: IndexOutOfBoundsException => // transpose freaked out because of irregular argss
// catching just in case (shouldn't happen, but also doesn't cost us)
- if (settings.debug.value) log("transposed irregular matrix!?"+ (tps, argss))
+ debuglog("transposed irregular matrix!?"+ (tps, argss))
None
}
case SingleType(_, sym) :: rest =>
@@ -5770,7 +5769,7 @@ A type's typeSymbol should never be inspected directly.
*/
def addMember(thistp: Type, tp: Type, sym: Symbol) {
assert(sym != NoSymbol)
- // if (settings.debug.value) log("add member " + sym+":"+sym.info+" to "+thistp) //DEBUG
+ // debuglog("add member " + sym+":"+sym.info+" to "+thistp) //DEBUG
if (!(thistp specializes sym)) {
if (sym.isTerm)
for (alt <- tp.nonPrivateDecl(sym.name).alternatives)
@@ -5909,7 +5908,7 @@ A type's typeSymbol should never be inspected directly.
if (!(declaredBoundsInst <:< argumentBounds))
stricterBound(hkarg, hkparam)
- if (settings.debug.value) log(
+ debuglog(
"checkKindBoundsHK base case: " + hkparam +
" declared bounds: " + declaredBounds +
" after instantiating earlier hkparams: " + declaredBoundsInst + "\n" +
@@ -5918,8 +5917,7 @@ A type's typeSymbol should never be inspected directly.
)
}
else {
- if (settings.debug.value)
- log("checkKindBoundsHK recursing to compare params of "+ hkparam +" with "+ hkarg)
+ debuglog("checkKindBoundsHK recursing to compare params of "+ hkparam +" with "+ hkarg)
val (am, vm, sb) = checkKindBoundsHK(
hkarg.typeParams,
hkarg,