1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-23 23:32:55 +00:00

Improved verbosity for fragment debug output.

This commit is contained in:
jespergravgaard 2019-03-12 17:59:35 +01:00
parent ad6a1910c8
commit 6adb0c6d2d

View File

@ -118,16 +118,21 @@ public class KickC implements Callable<Void> {
}
if(fragment!=null) {
configVerbosity(compiler);
if(verbose) {
compiler.getLog().setVerboseFragmentLog(true);
}
compiler.getLog().setSysOut(true);
Collection<AsmFragmentTemplate> fragmentTemplates = AsmFragmentTemplateSynthesizer.getFragmentTemplates(fragment, compiler.getLog());
for(AsmFragmentTemplate fragmentTemplate : fragmentTemplates) {
AsmFragmentTemplateUsages.logTemplate(compiler.getLog(), fragmentTemplate, "");
}
compiler.getLog().setSysOut(false);
}
if(kcFile!=null) {
configVerbosity(compiler);
String fileBaseName = getFileBaseName(kcFile);
Path kcFileDir = kcFile.getParent();
@ -150,55 +155,6 @@ public class KickC implements Callable<Void> {
compiler.setUpliftCombinations(optimizeUpliftCombinations);
}
if(verbose) {
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());
@ -250,6 +206,57 @@ public class KickC implements Callable<Void> {
return null;
}
private void configVerbosity(Compiler compiler) {
if(verbose) {
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);
}
}
/**
* Get the current version of KickC
* @return The name and version (eg "KickC 0.5")