diff options
author | Martin Odersky <odersky@gmail.com> | 2008-06-20 16:00:28 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-06-20 16:00:28 +0000 |
commit | 1324218fd520c7a2e326b7c40c7bbb1a1dbb4803 (patch) | |
tree | 48977fa163008964095add8c41008301662110be /src/compiler/scala/tools/nsc/Global.scala | |
parent | 2ed788315cbf63ee18d42cf18bb45a3391cd6189 (diff) | |
download | scala-1324218fd520c7a2e326b7c40c7bbb1a1dbb4803.tar.gz scala-1324218fd520c7a2e326b7c40c7bbb1a1dbb4803.tar.bz2 scala-1324218fd520c7a2e326b7c40c7bbb1a1dbb4803.zip |
use early initialization instead of relying on ...
use early initialization instead of relying on compiler moving valdefs
in front of constructors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 154 |
1 files changed, 78 insertions, 76 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index dd0ca0da10..e3f6bf85db 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -53,47 +53,49 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable } val nodeToString = nodePrinters.nodeToString - object gen extends TreeGen { + object gen extends { val global: Global.this.type = Global.this + } with TreeGen { def mkAttributedCast(tree: Tree, pt: Type): Tree = typer.typed(mkAttributedCastUntyped(tree, pt)) } - object constfold extends ConstantFolder { + object constfold extends { val global: Global.this.type = Global.this - } + } with ConstantFolder - object checker extends TreeCheckers { + object checker extends { val global: Global.this.type = Global.this - } + } with TreeCheckers - object icodes extends ICodes { + object icodes extends { val global: Global.this.type = Global.this - } + } with ICodes - object analysis extends TypeFlowAnalysis { + object analysis extends { val global: Global.this.type = Global.this - } + } with TypeFlowAnalysis - object copyPropagation extends CopyPropagation { + object copyPropagation extends { val global: Global.this.type = Global.this - } + } with CopyPropagation - object checkers extends Checkers { + object checkers extends { val global: Global.this.type = Global.this - } + } with Checkers - object statistics extends Statistics { + object statistics extends { val global: Global.this.type = Global.this - } + } with Statistics - object overridingPairs extends OverridingPairs { + object overridingPairs extends { val global: Global.this.type = Global.this - } + } with OverridingPairs - object treeBrowsers extends TreeBrowsers { + object treeBrowsers extends { val global: Global.this.type = Global.this - } + } with TreeBrowsers + val treeBrowser = treeBrowsers.create() @@ -221,7 +223,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable getSourceFile(ret.sourceFile) } - val loaders : SymbolLoaders { val global : Global.this.type } = new SymbolLoaders { + val loaders : SymbolLoaders { val global : Global.this.type } = new SymbolLoaders {//change? lazy val global: Global.this.type = Global.this } @@ -273,122 +275,122 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable def apply(unit: CompilationUnit) {} } - object syntaxAnalyzer extends SyntaxAnalyzer { + object syntaxAnalyzer extends { val global: Global.this.type = Global.this - } + } with SyntaxAnalyzer - object analyzer extends Analyzer { + object analyzer extends { val global: Global.this.type = Global.this - } + } with Analyzer - object superAccessors extends SuperAccessors { + object superAccessors extends { val global: Global.this.type = Global.this - } + } with SuperAccessors - object pickler extends Pickler { + object pickler extends { val global: Global.this.type = Global.this - } + } with Pickler - object refchecks extends RefChecks { + object refchecks extends { val global: Global.this.type = Global.this - } + } with RefChecks /* - object devirtualize extends DeVirtualize { + object devirtualize extends { val global: Global.this.type = Global.this - } + } with DeVirtualize */ - object liftcode extends LiftCode { + object liftcode extends { val global: Global.this.type = Global.this - } + } with LiftCode - object uncurry extends UnCurry { + object uncurry extends { val global: Global.this.type = Global.this - } + } with UnCurry - object tailCalls extends TailCalls { + object tailCalls extends { val global: Global.this.type = Global.this - } + } with TailCalls - //object transMatcher extends TransMatcher { + //object transMatcher extends { // val global: Global.this.type = Global.this - //} + //} with TransMatcher -// object checkDefined extends CheckDefined { +// object checkDefined extends { // val global: Global.this.type = Global.this -// } +// } with CheckDefined - object explicitOuter extends ExplicitOuter { + object explicitOuter extends { val global: Global.this.type = Global.this - } + } with ExplicitOuter - object erasure extends Erasure { + object erasure extends { val global: Global.this.type = Global.this - } + } with Erasure - object lazyVals extends LazyVals { + object lazyVals extends { val global: Global.this.type = Global.this final val FLAGS_PER_WORD = 32 - } + } with LazyVals - object lambdaLift extends LambdaLift { + object lambdaLift extends { val global: Global.this.type = Global.this - } + } with LambdaLift - object constructors extends Constructors { + object constructors extends { val global: Global.this.type = Global.this - } + } with Constructors - object flatten extends Flatten { + object flatten extends { val global: Global.this.type = Global.this - } + } with Flatten /* - object detach extends Detach { + object detach extends { val global: Global.this.type = Global.this - } + } with Detach */ - object mixer extends Mixin { + object mixer extends { val global: Global.this.type = Global.this - } + } with Mixin - object cleanup extends CleanUp { + object cleanup extends { val global: Global.this.type = Global.this - } + } with CleanUp - object sampleTransform extends SampleTransform { + object sampleTransform extends { val global: Global.this.type = Global.this - } + } with SampleTransform - object genicode extends GenICode { + object genicode extends { val global: Global.this.type = Global.this - } + } with GenICode /* object icodePrinter extends backend.icode.Printers { val global: Global.this.type = Global.this } */ - object scalaPrimitives extends ScalaPrimitives { + object scalaPrimitives extends { val global: Global.this.type = Global.this - } + } with ScalaPrimitives - object inliner extends Inliners { + object inliner extends { val global: Global.this.type = Global.this - } + } with Inliners - object closureElimination extends ClosureElimination { + object closureElimination extends { val global: Global.this.type = Global.this - } + } with ClosureElimination - object deadCode extends DeadCodeElimination { + object deadCode extends { val global: Global.this.type = Global.this - } + } with DeadCodeElimination - object genJVM extends GenJVM { + object genJVM extends { val global: Global.this.type = Global.this - } + } with GenJVM - object genMSIL extends GenMSIL { + object genMSIL extends { val global: Global.this.type = Global.this - } + } with GenMSIL object icodeChecker extends checkers.ICodeChecker() |