summaryrefslogtreecommitdiff
path: root/src/continuations
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-08-03 21:17:25 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-08-03 21:17:25 -0700
commitb23a0df06d4479e4e29aa2ce629f4704f29ab5a0 (patch)
tree781d7e24db6ff030a83e9e2ddffc1607890fa40a /src/continuations
parentf26ac6e643a54379c7bfd992356f88f6202b6081 (diff)
parent75eb8a49842075bcaa2878b262443b48aafec2ab (diff)
downloadscala-b23a0df06d4479e4e29aa2ce629f4704f29ab5a0.tar.gz
scala-b23a0df06d4479e4e29aa2ce629f4704f29ab5a0.tar.bz2
scala-b23a0df06d4479e4e29aa2ce629f4704f29ab5a0.zip
Merge pull request #982 from adriaanm/ticket-wolfcry
SI-5930 SI-5897 reduce redundant warnings in matches, fix flags usage
Diffstat (limited to 'src/continuations')
-rw-r--r--src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala
index 211560e343..51760d2807 100644
--- a/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala
+++ b/src/continuations/plugin/scala/tools/selectivecps/SelectiveANFTransform.scala
@@ -99,11 +99,11 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with
treeCopy.Block(body, List(transform(selDef)), transformPureMatch(mat, selector, cases))
// virtpatmat
- case b@Block(matchStats@((selDef: ValDef) :: cases), matchEnd) if ext.isDefined && pureBody && (matchStats forall gen.hasSynthCaseSymbol) =>
+ case b@Block(matchStats@((selDef: ValDef) :: cases), matchEnd) if ext.isDefined && pureBody && (matchStats forall treeInfo.hasSynthCaseSymbol) =>
transformPureVirtMatch(b, selDef, cases, matchEnd)
// virtpatmat that stores the scrut separately -- TODO: can we eliminate this case??
- case Block(List(selDef0: ValDef), mat@Block(matchStats@((selDef: ValDef) :: cases), matchEnd)) if ext.isDefined && pureBody && (matchStats forall gen.hasSynthCaseSymbol)=>
+ case Block(List(selDef0: ValDef), mat@Block(matchStats@((selDef: ValDef) :: cases), matchEnd)) if ext.isDefined && pureBody && (matchStats forall treeInfo.hasSynthCaseSymbol)=>
treeCopy.Block(body, List(transform(selDef0)), transformPureVirtMatch(mat, selDef, cases, matchEnd))
case _ =>
@@ -253,7 +253,7 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with
// calling each labeldef is wrong, since some labels may be jumped over
// we can get away with this for now since the only other labels we emit are for tailcalls/while loops,
// which do not have consecutive labeldefs (and thus fall-through is irrelevant)
- if (gen.hasSynthCaseSymbol(ldef)) (List(stm1), localTyper.typed{Literal(Constant(()))}, cpsA)
+ if (treeInfo.hasSynthCaseSymbol(ldef)) (List(stm1), localTyper.typed{Literal(Constant(()))}, cpsA)
else {
assert(params.isEmpty, "problem in ANF transforming label with non-empty params "+ ldef)
(List(stm1), localTyper.typed{Apply(Ident(sym), List())}, cpsA)
@@ -469,9 +469,9 @@ abstract class SelectiveANFTransform extends PluginComponent with Transform with
val (anfStats, anfExpr) = rec(stms, cpsA, List())
// println("\nanf-block:\n"+ ((stms :+ expr) mkString ("{", "\n", "}")) +"\nBECAME\n"+ ((anfStats :+ anfExpr) mkString ("{", "\n", "}")))
- // println("synth case? "+ (anfStats map (t => (t, t.isDef, gen.hasSynthCaseSymbol(t)))))
+ // println("synth case? "+ (anfStats map (t => (t, t.isDef, treeInfo.hasSynthCaseSymbol(t)))))
// SUPER UGLY HACK: handle virtpatmat-style matches, whose labels have already been turned into DefDefs
- if (anfStats.nonEmpty && (anfStats forall (t => !t.isDef || gen.hasSynthCaseSymbol(t)))) {
+ if (anfStats.nonEmpty && (anfStats forall (t => !t.isDef || treeInfo.hasSynthCaseSymbol(t)))) {
val (prologue, rest) = (anfStats :+ anfExpr) span (s => !s.isInstanceOf[DefDef]) // find first case
// println("rest: "+ rest)
// val (defs, calls) = rest partition (_.isInstanceOf[DefDef])