aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Contexts.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-12 18:10:23 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-12 18:10:23 +0200
commit401d2012f4c99b170dec99c1f7c4251dda0b20fd (patch)
tree9014bfa8a139242fdc6233917adb0a5c610379d5 /src/dotty/tools/dotc/core/Contexts.scala
parent34317c162e9d79729e57d22bb167f420e948da8f (diff)
downloaddotty-401d2012f4c99b170dec99c1f7c4251dda0b20fd.tar.gz
dotty-401d2012f4c99b170dec99c1f7c4251dda0b20fd.tar.bz2
dotty-401d2012f4c99b170dec99c1f7c4251dda0b20fd.zip
Refactored handling of phases to make them more robust and simpler to install.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r--src/dotty/tools/dotc/core/Contexts.scala9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala
index ee67ec76e..a193da372 100644
--- a/src/dotty/tools/dotc/core/Contexts.scala
+++ b/src/dotty/tools/dotc/core/Contexts.scala
@@ -373,8 +373,8 @@ object Contexts {
/** The loader that loads the members of _root_ */
def rootLoader(root: TermSymbol)(implicit ctx: Context): SymbolLoader = platform.rootLoader(root)
- NoPhase // initialize some phases
- SomePhase // TODO: Is there a cleaner way to do this?
+ // Set up some phases to get started */
+ usePhases(SomePhase :: Nil)
/** The standard definitions */
val definitions = new Definitions()(initialCtx)
@@ -434,10 +434,7 @@ object Contexts {
// Phases state
/** Phases by id */
- private[core] var phases = new Array[Phase](MaxPossiblePhaseId + 1)
-
- /** The number of defined phases. This includes NoPhase, so nphases >= 1 */
- private[core] var nphases = 0
+ private[core] var phases: Array[Phase] = _
// Printers state
/** Number of recursive invocations of a show method on cuyrrent stack */