diff options
author | paltherr <paltherr@epfl.ch> | 2003-03-21 17:51:47 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-03-21 17:51:47 +0000 |
commit | 0aa9fd3d2ec47666e223f091bdee878bd1b0aacb (patch) | |
tree | 63319e660c57a64894697ad49f093f4cda694b90 /sources/scalac/backend | |
parent | e2a09f258a66f71ea90e65b645d8a03b1a64be71 (diff) | |
download | scala-0aa9fd3d2ec47666e223f091bdee878bd1b0aacb.tar.gz scala-0aa9fd3d2ec47666e223f091bdee878bd1b0aacb.tar.bz2 scala-0aa9fd3d2ec47666e223f091bdee878bd1b0aacb.zip |
- Removed class Phase.
- Removed argument descr in constructors of the class Transformer and of
its subclasses.
Diffstat (limited to 'sources/scalac/backend')
-rw-r--r-- | sources/scalac/backend/jvm/GenJVM.java | 12 | ||||
-rw-r--r-- | sources/scalac/backend/jvm/GenJVMPhase.java | 5 | ||||
-rw-r--r-- | sources/scalac/backend/msil/GenMSIL.java | 16 | ||||
-rw-r--r-- | sources/scalac/backend/msil/GenMSILPhase.java | 1 | ||||
-rw-r--r-- | sources/scalac/backend/msil/TypeCreator.java | 7 |
5 files changed, 14 insertions, 27 deletions
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java index 60e426e410..e76728903f 100644 --- a/sources/scalac/backend/jvm/GenJVM.java +++ b/sources/scalac/backend/jvm/GenJVM.java @@ -2,7 +2,6 @@ ** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** ** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** ** /_____/\____/\___/\____/____/ ** -** ** \* */ // $OldId: GenJVM.java,v 1.29 2003/02/05 09:32:17 schinz Exp $ @@ -37,17 +36,6 @@ import java.io.*; * @author Michel Schinz */ -public class GenJVM extends Phase { - public GenJVM(Global global, PhaseDescriptor descr) { - super(global, descr); - } - - public void apply(Unit unit) { - JVMGenerator gen = new JVMGenerator(global); - gen.translate(unit); - } -} - class JVMGenerator { protected final static String JAVA_LANG_OBJECT = "java.lang.Object"; protected final static String JAVA_LANG_STRING = "java.lang.String"; diff --git a/sources/scalac/backend/jvm/GenJVMPhase.java b/sources/scalac/backend/jvm/GenJVMPhase.java index bdfb7bc02f..553853b732 100644 --- a/sources/scalac/backend/jvm/GenJVMPhase.java +++ b/sources/scalac/backend/jvm/GenJVMPhase.java @@ -11,7 +11,6 @@ package scalac.backend.jvm; import scalac.Global; import scalac.Unit; -import scalac.Phase; import scalac.PhaseDescriptor; import scalac.ApplicationError; @@ -31,7 +30,9 @@ public class GenJVMPhase extends PhaseDescriptor { } public void apply(Global global) { - new GenJVM(global, this).apply(); + for (int i = 0; i < global.units.length; i++) { + new JVMGenerator(global).translate(global.units[i]); + } } } diff --git a/sources/scalac/backend/msil/GenMSIL.java b/sources/scalac/backend/msil/GenMSIL.java index e126b72216..5d405641d2 100644 --- a/sources/scalac/backend/msil/GenMSIL.java +++ b/sources/scalac/backend/msil/GenMSIL.java @@ -2,17 +2,14 @@ ** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** ** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** ** /_____/\____/\___/\____/____/ ** -** ** -** $Id$ \* */ +// $Id$ package scalac.backend.msil; import scalac.Global; import scalac.Unit; -import scalac.Phase; -import scalac.PhaseDescriptor; import scalac.ApplicationError; import scalac.util.Debug; @@ -50,7 +47,7 @@ import java.io.IOException; * @author Nikolay Mihaylov */ -public class GenMSIL extends Phase /*implements Modifiers */ { +public class GenMSIL /*implements Modifiers */ { final Map assemblies; @@ -62,6 +59,7 @@ public class GenMSIL extends Phase /*implements Modifiers */ { ILGenerator code; + final Global global; final TypeCreator tc; final Definitions defs; final Primitives primitives; @@ -104,12 +102,12 @@ public class GenMSIL extends Phase /*implements Modifiers */ { /** */ public GenMSIL(Global global, GenMSILPhase phase) { - super(global, phase); + this.global = global; defs = global.definitions; primitives = global.primitives; assemblies = phase.assemblies; - tc = new TypeCreator(this); + tc = new TypeCreator(this, phase); items = new ItemFactory(this); currentPackage = defs.ROOT_CLASS; /// ??? @@ -158,7 +156,9 @@ public class GenMSIL extends Phase /*implements Modifiers */ { tc.traverse(global.units); try { - super.apply(); // this invokes apply(Unit) for each Unit + for (int i = 0; i < global.units.length; i++) { + apply(global.units[i]); + } } catch (Throwable e) { //log("params: " + params); //log("locals: " + locals); diff --git a/sources/scalac/backend/msil/GenMSILPhase.java b/sources/scalac/backend/msil/GenMSILPhase.java index 3156db748d..aa931a693b 100644 --- a/sources/scalac/backend/msil/GenMSILPhase.java +++ b/sources/scalac/backend/msil/GenMSILPhase.java @@ -10,7 +10,6 @@ package scalac.backend.msil; import scalac.Global; import scalac.Unit; -import scalac.Phase; import scalac.PhaseDescriptor; import java.util.HashMap; diff --git a/sources/scalac/backend/msil/TypeCreator.java b/sources/scalac/backend/msil/TypeCreator.java index aff49c99fc..e89bff38de 100644 --- a/sources/scalac/backend/msil/TypeCreator.java +++ b/sources/scalac/backend/msil/TypeCreator.java @@ -2,10 +2,10 @@ ** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** ** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** ** /_____/\____/\___/\____/____/ ** -** ** -** $Id$ \* */ +// $Id$ + package scalac.backend.msil; import scalac.Global; @@ -98,12 +98,11 @@ public final class TypeCreator throw Debug.abort(e); } } - TypeCreator(GenMSIL _gen) { + TypeCreator(GenMSIL _gen, GenMSILPhase phase) { gen = _gen; global = gen.global; defs = global.definitions; - GenMSILPhase phase = (GenMSILPhase) gen.descr; types2symbols = phase.types2symbols; symbols2types = phase.symbols2types; symbols2fields = phase.symbols2fields; |