diff options
Diffstat (limited to 'sources/scalac/Global.java')
-rw-r--r-- | sources/scalac/Global.java | 23 |
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; |