1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-30 09:50:13 +00:00

Added a few verbosity options plus a missing fragment.

This commit is contained in:
jespergravgaard 2018-10-16 02:02:30 +02:00
parent 6bd55add24
commit 25f5d77f34

View File

@ -23,7 +23,7 @@ import java.util.concurrent.Callable;
descriptionHeading = "%nDescription:%n%n", descriptionHeading = "%nDescription:%n%n",
parameterListHeading = "%nParameters:%n", parameterListHeading = "%nParameters:%n",
optionListHeading = "%nOptions:%n", optionListHeading = "%nOptions:%n",
version = "KickC 0.5" version = "KickC 0.5 (master)"
) )
public class KickC implements Callable<Void> { public class KickC implements Callable<Void> {
@ -51,6 +51,12 @@ public class KickC implements Callable<Void> {
@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.") @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; 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) { public static void main(String[] args) {
CommandLine.call(new KickC(), args); CommandLine.call(new KickC(), args);
} }
@ -97,6 +103,15 @@ public class KickC implements Callable<Void> {
compiler.setUpliftCombinations(optimizeUpliftCombinations); compiler.setUpliftCombinations(optimizeUpliftCombinations);
} }
if(verbose) {
compiler.getLog().setSysOut(true);
}
if(verboseFragments) {
compiler.getLog().setVerboseFragmentLog(true);
compiler.getLog().setSysOut(true);
}
System.out.println("Compiling " + kcFile); System.out.println("Compiling " + kcFile);
Program program = compiler.compile(kcFile.toString()); Program program = compiler.compile(kcFile.toString());