From 25f5d77f34a9d6fe9f240fa591b9bf1cd2bfb05b Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Tue, 16 Oct 2018 02:02:30 +0200 Subject: [PATCH] Added a few verbosity options plus a missing fragment. --- src/main/java/dk/camelot64/kickc/KickC.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/dk/camelot64/kickc/KickC.java b/src/main/java/dk/camelot64/kickc/KickC.java index 13efada19..bf90434e7 100644 --- a/src/main/java/dk/camelot64/kickc/KickC.java +++ b/src/main/java/dk/camelot64/kickc/KickC.java @@ -23,7 +23,7 @@ import java.util.concurrent.Callable; descriptionHeading = "%nDescription:%n%n", parameterListHeading = "%nParameters:%n", optionListHeading = "%nOptions:%n", - version = "KickC 0.5" + version = "KickC 0.5 (master)" ) public class KickC implements Callable { @@ -51,6 +51,12 @@ public class KickC implements Callable { @CommandLine.Option(names = {"-Ouplift" }, description = "Optimization Option. Number of combinations to test when uplifting variables to registers in a scope. By default 100 combinations are tested.") private Integer optimizeUpliftCombinations = null; + @CommandLine.Option(names = {"-v" }, description = "Verbose output describing the compilation process") + private boolean verbose= false; + + @CommandLine.Option(names = {"-vfragment" }, description = "Verbosity Option. Synthesis of ASM fragments is printed during compilation.") + private boolean verboseFragments= false; + public static void main(String[] args) { CommandLine.call(new KickC(), args); } @@ -97,6 +103,15 @@ public class KickC implements Callable { compiler.setUpliftCombinations(optimizeUpliftCombinations); } + if(verbose) { + compiler.getLog().setSysOut(true); + } + + if(verboseFragments) { + compiler.getLog().setVerboseFragmentLog(true); + compiler.getLog().setSysOut(true); + } + System.out.println("Compiling " + kcFile); Program program = compiler.compile(kcFile.toString());