summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-12-28 21:32:59 +0000
committerPaul Phillips <paulp@improving.org>2010-12-28 21:32:59 +0000
commitd04cfc06f0ebc671f95e881131d961631de638a2 (patch)
tree99682c3cbb47b96339f84cccc74b1faa085e0e14 /src
parent5f32d546950f55e31bf380009aff5538d630afaf (diff)
downloadscala-d04cfc06f0ebc671f95e881131d961631de638a2.tar.gz
scala-d04cfc06f0ebc671f95e881131d961631de638a2.tar.bz2
scala-d04cfc06f0ebc671f95e881131d961631de638a2.zip
Added withFilter to the list of monadic method ...
Added withFilter to the list of monadic method names: otherwise the inliner doesn't recognize its attractiveness. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/opt/Inliners.scala4
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala1
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Analyzer.scala2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
index acb4274cb2..0db14d5e59 100644
--- a/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
+++ b/src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
@@ -237,8 +237,8 @@ abstract class Inliners extends SubComponent {
}
private def isMonadicMethod(sym: Symbol) = sym.name match {
- case nme.foreach | nme.filter | nme.map | nme.flatMap => true
- case _ => false
+ case nme.foreach | nme.filter | nme.withFilter | nme.map | nme.flatMap => true
+ case _ => false
}
private def isHigherOrderMethod(sym: Symbol) =
sym.isMethod && atPhase(currentRun.erasurePhase.prev)(sym.info.paramTypes exists isFunctionType)
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 5f5c1bfb90..42cbcdd4eb 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -103,6 +103,7 @@ trait Types extends reflect.generic.Types { self: SymbolTable =>
object undoLog {
private type UndoLog = List[(TypeVar, TypeConstraint)]
private[nsc] var log: UndoLog = List()
+ private[nsc] def size() = log.size
/** Undo all changes to constraints to type variables upto `limit'
*/
diff --git a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
index 56f1fd4c53..6e969d07a4 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Analyzer.scala
@@ -84,6 +84,8 @@ trait Analyzer extends AnyRef
val start = startTimer(typerNanos)
global.echoPhaseSummary(this)
currentRun.units foreach applyPhase
+ if (global.opt.debug)
+ log("Clearing " + undoLog.size() + " entries from the undoLog.")
undoLog.clear()
// need to clear it after as well or 10K+ accumulated entries are
// uncollectable the rest of the way.