summaryrefslogtreecommitdiff
path: root/sources/scalac/backend/msil/GenMSILPhase.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/backend/msil/GenMSILPhase.java')
-rw-r--r--sources/scalac/backend/msil/GenMSILPhase.java36
1 files changed, 21 insertions, 15 deletions
diff --git a/sources/scalac/backend/msil/GenMSILPhase.java b/sources/scalac/backend/msil/GenMSILPhase.java
index 0e814e2346..6ba91bf7eb 100644
--- a/sources/scalac/backend/msil/GenMSILPhase.java
+++ b/sources/scalac/backend/msil/GenMSILPhase.java
@@ -9,12 +9,19 @@
package scalac.backend.msil;
import scalac.Global;
-import scalac.Unit;
+import scalac.Phase;
import scalac.PhaseDescriptor;
+import scalac.Unit;
import java.util.HashMap;
-public class GenMSILPhase extends PhaseDescriptor {
+public class GenMSILPhase extends Phase {
+
+ //########################################################################
+ // Private Fields
+
+ /** The tree to code translator */
+ private final GenMSIL translator;
final HashMap assemblies = new HashMap();
@@ -24,23 +31,22 @@ public class GenMSILPhase extends PhaseDescriptor {
final HashMap symbols2methods = new HashMap();
final HashMap symbols2moduleFields = new HashMap();
- public String name () {
- return "genmsil";
- }
+ //########################################################################
+ // Public Constructors
- public String description () {
- return "generate MSIL code";
+ /** Initializes this instance. */
+ public GenMSILPhase(Global global, PhaseDescriptor descriptor) {
+ super(global, descriptor);
+ this.translator = new GenMSIL(global, this);
}
- public String taskDescription() {
- return "generated MSIL code";
- }
+ //########################################################################
+ // Public Methods
- public void apply(Global global) {
- new GenMSIL(global, this).apply();
+ /** Applies this phase to the given compilation units. */
+ public void apply(Unit[] units) {
+ for (int i = 0; i < units.length; i++) translator.apply(units[i]);
}
- public void apply(Unit unit) {
- new GenMSIL(unit.global, this).apply(unit);
- }
+ //########################################################################
}