summaryrefslogtreecommitdiff
path: root/sources/scalac/Global.java
diff options
context:
space:
mode:
authorNAME <USER@epfl.ch>2004-01-30 13:07:45 +0000
committerNAME <USER@epfl.ch>2004-01-30 13:07:45 +0000
commitbec9884b00d60a79671e51a5a65b1717f753f981 (patch)
tree0a8d4bfa78fbe173ddaf6a8fa8f1e34902f8ee84 /sources/scalac/Global.java
parent0bc48e99d91c250590e6ec1ed376aec348df5cb4 (diff)
downloadscala-bec9884b00d60a79671e51a5a65b1717f753f981.tar.gz
scala-bec9884b00d60a79671e51a5a65b1717f753f981.tar.bz2
scala-bec9884b00d60a79671e51a5a65b1717f753f981.zip
Added intermediate code and corresponding jvm b...
Added intermediate code and corresponding jvm backend
Diffstat (limited to 'sources/scalac/Global.java')
-rw-r--r--sources/scalac/Global.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index bd411f7439..37e2ed95d9 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -136,11 +136,13 @@ public class Global {
public static final String TARGET_INT;
public static final String TARGET_JVM;
public static final String TARGET_MSIL;
+ public static final String TARGET_JVMFROMICODE;
public static final String[] TARGETS = new String[] {
- TARGET_INT = "int",
- TARGET_JVM = "jvm",
- TARGET_MSIL = "msil",
+ TARGET_INT = "int",
+ TARGET_JVM = "jvm",
+ TARGET_MSIL = "msil",
+ TARGET_JVMFROMICODE = "jvmfromicode"
};
/** tree printers
@@ -225,6 +227,12 @@ public class Global {
// TODO: Enable TailCall for other backends when they handle LabelDefs
if (target != TARGET_MSIL) args.phases.GENMSIL.addSkipFlag();
if (target != TARGET_JVM) args.phases.GENJVM.addSkipFlag();
+ if (target != TARGET_JVMFROMICODE) {
+ args.phases.ICODE.addSkipFlag();
+ args.phases.GENJVMFROMICODE.addSkipFlag();
+ } else {
+ ;//args.phases.ERASURE.addSkipFlag();
+ }
PHASE.freeze();
PhaseDescriptor[] descriptors = PHASE.phases();
this.firstPhase = descriptors[0].create(this);
@@ -334,6 +342,15 @@ public class Global {
printer.printGlobal(this);
if (next) currentPhase = currentPhase.prev;
if (html) writer.println("</pre>");
+ } else if (currentPhase.id == PHASE.ICODE.id()) {
+ boolean html = args.printer.value.equals(PRINTER_HTML);
+ if (html) writer.println("<pre>");
+ ATreePrinter printer = ((scalac.transformer.ICodePhase)currentPhase).getPrinter(new CodePrinter(writer)); // Oh !!
+ boolean next = currentPhase.next != null;
+ if (next) currentPhase = currentPhase.next;
+ printer.printGlobal(this);
+ if (next) currentPhase = currentPhase.prev;
+ if (html) writer.println("</pre>");
} else {
// go to next phase to print symbols with their new type
boolean next = currentPhase.next != null;