From 17cb00955c79c124b4e9ef0eaebd17a0fb8c0a2d Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Tue, 16 Oct 2018 17:29:00 +0200 Subject: [PATCH] Added all current verbosity options. --- .../java/dk/camelot64/kickc/CompileLog.java | 24 +++++++ src/main/java/dk/camelot64/kickc/KickC.java | 72 ++++++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/src/main/java/dk/camelot64/kickc/CompileLog.java b/src/main/java/dk/camelot64/kickc/CompileLog.java index d19480ff6..e90400437 100644 --- a/src/main/java/dk/camelot64/kickc/CompileLog.java +++ b/src/main/java/dk/camelot64/kickc/CompileLog.java @@ -84,6 +84,30 @@ public class CompileLog { return log; } + public void setVerboseLoopUnroll(boolean verboseLoopUnroll) { + this.verboseLoopUnroll = verboseLoopUnroll; + } + + public void setVerboseLoopAnalysis(boolean verboseLoopAnalysis) { + this.verboseLoopAnalysis = verboseLoopAnalysis; + } + + public void setVerboseNonOptimization(boolean verboseNonOptimization) { + this.verboseNonOptimization = verboseNonOptimization; + } + + public void setVerboseSequencePlan(boolean verboseSequencePlan) { + this.verboseSequencePlan = verboseSequencePlan; + } + + public void setVerboseParse(boolean verboseParse) { + this.verboseParse = verboseParse; + } + + public void setVerboseCreateSsa(boolean verboseCreateSsa) { + this.verboseCreateSsa = verboseCreateSsa; + } + public boolean isVerboseUplift() { return verboseUplift; } diff --git a/src/main/java/dk/camelot64/kickc/KickC.java b/src/main/java/dk/camelot64/kickc/KickC.java index bf90434e7..7635d1eb0 100644 --- a/src/main/java/dk/camelot64/kickc/KickC.java +++ b/src/main/java/dk/camelot64/kickc/KickC.java @@ -54,9 +54,39 @@ public class KickC implements Callable { @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.") + @CommandLine.Option(names = {"-vparse" }, description = "Verbosity Option. File Parsing.") + private boolean verboseParse = false; + + @CommandLine.Option(names = {"-vcreate" }, description = "Verbosity Option. Creation of the Single Static Assignment Control Flow Graph.") + private boolean verboseCreateSsa = false; + + @CommandLine.Option(names = {"-voptimize" }, description = "Verbosity Option. Control Flow Graph Optimization.") + private boolean verboseSSAOptimize = false; + + @CommandLine.Option(names = {"-vnonoptimize" }, description = "Verbosity Option. Choices not to optimize.") + private boolean verboseNonOptimization = false; + + @CommandLine.Option(names = {"-vsequence" }, description = "Verbosity Option. Sequence Plan.") + private boolean verboseSequencePlan = false; + + @CommandLine.Option(names = {"-vloop" }, description = "Verbosity Option. Loop Analysis.") + private boolean verboseLoopAnalysis = false; + + @CommandLine.Option(names = {"-vliverange" }, description = "Verbosity Option. Variable Live Range Analysis.") + private boolean verboseLiveRanges = false; + + @CommandLine.Option(names = {"-vuplift" }, description = "Verbosity Option. Variable Register Uplift Combination Optimization.") + private boolean verboseUplift = false; + + @CommandLine.Option(names = {"-vunroll" }, description = "Verbosity Option. Loop Unrolling.") + private boolean verboseLoopUnroll = false; + + @CommandLine.Option(names = {"-vfragment" }, description = "Verbosity Option. Synthesis of Assembler fragments.") private boolean verboseFragments= false; + @CommandLine.Option(names = {"-vasmoptimize" }, description = "Verbosity Option. Assembler optimization.") + private boolean verboseAsmOptimize = false; + public static void main(String[] args) { CommandLine.call(new KickC(), args); } @@ -107,10 +137,50 @@ public class KickC implements Callable { compiler.getLog().setSysOut(true); } + if(verboseParse) { + compiler.getLog().setVerboseParse(true); + compiler.getLog().setSysOut(true); + } + if(verboseCreateSsa) { + compiler.getLog().setVerboseCreateSsa(true); + compiler.getLog().setSysOut(true); + } + if(verboseSSAOptimize) { + compiler.getLog().setVerboseSSAOptimize(true); + compiler.getLog().setSysOut(true); + } + if(verboseNonOptimization) { + compiler.getLog().setVerboseNonOptimization(true); + compiler.getLog().setSysOut(true); + } + if(verboseSequencePlan) { + compiler.getLog().setVerboseSequencePlan(true); + compiler.getLog().setSysOut(true); + } + if(verboseLoopAnalysis) { + compiler.getLog().setVerboseLoopAnalysis(true); + compiler.getLog().setSysOut(true); + } + if(verboseLoopUnroll) { + compiler.getLog().setVerboseLoopUnroll(true); + compiler.getLog().setSysOut(true); + } + if(verboseLiveRanges) { + compiler.getLog().setVerboseLiveRanges(true); + compiler.getLog().setSysOut(true); + } + if(verboseUplift) { + compiler.getLog().setVerboseUplift(true); + compiler.getLog().setSysOut(true); + } if(verboseFragments) { compiler.getLog().setVerboseFragmentLog(true); compiler.getLog().setSysOut(true); } + if(verboseAsmOptimize) { + compiler.getLog().setVerboseAsmOptimize(true); + compiler.getLog().setSysOut(true); + } System.out.println("Compiling " + kcFile); Program program = compiler.compile(kcFile.toString());