summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/reify/Phases.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-06-06 14:29:05 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-06-08 15:32:03 +0200
commit6355d1a0b825c99560d4ccec1a8769f7421b1a71 (patch)
tree80f448f0da11dcab9cee30f3d8fe867cd66313ed /src/compiler/scala/reflect/reify/Phases.scala
parentce67870e64afabf75363679bcee597812ad223e9 (diff)
downloadscala-6355d1a0b825c99560d4ccec1a8769f7421b1a71.tar.gz
scala-6355d1a0b825c99560d4ccec1a8769f7421b1a71.tar.bz2
scala-6355d1a0b825c99560d4ccec1a8769f7421b1a71.zip
brings reification up to speed
Along with recovering from reflection refactoring, I implemented some new features (e.g. rollback of macro expansions), and did some stabilizing refactorings (e.g. moved mutable state into a ghetto). Also used the refactoring as a chance to fix free and aux symbols. Encapsulated this notion in a symbol table class, which allowed me to address outstanding issues with symbol table inheritance and inlining.
Diffstat (limited to 'src/compiler/scala/reflect/reify/Phases.scala')
-rw-r--r--src/compiler/scala/reflect/reify/Phases.scala21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/compiler/scala/reflect/reify/Phases.scala b/src/compiler/scala/reflect/reify/Phases.scala
index 49d5a45e8e..54336ee708 100644
--- a/src/compiler/scala/reflect/reify/Phases.scala
+++ b/src/compiler/scala/reflect/reify/Phases.scala
@@ -1,16 +1,16 @@
package scala.reflect
package reify
-import scala.reflect.reify.phases._
+import phases._
-trait Phases extends Calculate
- with Reshape
+trait Phases extends Reshape
+ with Calculate
with Metalevels
with Reify {
self: Reifier =>
- import mirror._
+ import global._
import definitions._
private var alreadyRun = false
@@ -26,16 +26,19 @@ trait Phases extends Calculate
if (reifyDebug) println("[reshape phase]")
tree = reshape.transform(tree)
+ if (reifyDebug) println("[interlude]")
+ if (reifyDebug) println("reifee = " + (if (opt.showTrees) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString))
+
+ if (reifyDebug) println("[calculate phase]")
+ calculate.traverse(tree)
if (reifyDebug) println("[metalevels phase]")
tree = metalevels.transform(tree)
-
if (reifyDebug) println("[interlude]")
- if (reifyDebug) println("symbol table = " + (if (symbolTable.length == 0) "<empty>" else ""))
- if (reifyDebug) symbolTable foreach (println(_))
- if (reifyDebug) println("reifee = " + (if (opt.showTrees) "\n" + nodePrinters.nodeToString(tree).trim else tree.toString))
+ if (reifyDebug) println(symtab.debugString)
+
if (reifyDebug) println("[reify phase]")
- var result = reify(tree)
+ val result = reify(tree)
result
}