From bec9884b00d60a79671e51a5a65b1717f753f981 Mon Sep 17 00:00:00 2001 From: NAME Date: Fri, 30 Jan 2004 13:07:45 +0000 Subject: Added intermediate code and corresponding jvm b... Added intermediate code and corresponding jvm backend --- sources/scalac/Global.java | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'sources/scalac/Global.java') 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(""); + } else if (currentPhase.id == PHASE.ICODE.id()) { + boolean html = args.printer.value.equals(PRINTER_HTML); + if (html) writer.println("
");
+	    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("
"); } else { // go to next phase to print symbols with their new type boolean next = currentPhase.next != null; -- cgit v1.2.3