Ignore:
Timestamp:
Feb 2, 2017, 9:17:55 PM (3 years ago)
Author:
cameron
Message:

Debug Options: SerializeThreads?; unify ShowIR, ShowPablo?, ShowREs, ShowASM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r5267 r5295  
    3030
    3131static cl::OptionCategory CodeGenOptions("Code Generation Options", "These options control code generation.");
    32 
    33 
    34 static cl::opt<bool> DumpGeneratedIR("dump-generated-IR", cl::init(false), cl::desc("Print LLVM IR generated by Pablo Compiler."), cl::cat(CodeGenOptions));
     32static cl::bits<DebugFlags>
     33DebugOptions(cl::values(clEnumVal(ShowIR, "Print generated LLVM IR."),
     34#if LLVM_VERSION_MINOR > 6
     35                        clEnumVal(ShowASM, "Print assembly code."),
     36#endif
     37                        clEnumVal(SerializeThreads, "Force segment threads to run sequentially."),
     38                        clEnumValEnd), cl::cat(CodeGenOptions));
     39
    3540static cl::opt<std::string> IROutputFilename("dump-generated-IR-output", cl::init(""), cl::desc("output IR filename"), cl::cat(CodeGenOptions));
    3641#if LLVM_VERSION_MINOR > 6
    37 static cl::opt<bool> DumpASM("DumpASM", cl::init(false), cl::desc("Print Assembly Code."), cl::cat(CodeGenOptions));
    38 #endif
    3942static cl::opt<std::string> ASMOutputFilename("asm-output", cl::init(""), cl::desc("output ASM filename"), cl::cat(CodeGenOptions));
    4043static cl::opt<bool> AsmVerbose("asm-verbose",
    4144                                cl::desc("Add comments to directives."),
    4245                                cl::init(true), cl::cat(CodeGenOptions));
     46#endif
    4347
    4448char OptLevel;
     
    6468const cl::OptionCategory * codegen_flags() {return &CodeGenOptions;}
    6569
     70bool DebugOptionIsSet(DebugFlags flag) {return DebugOptions.isSet(flag);}
     71
     72   
    6673#ifdef CUDA_ENABLED
    6774bool NVPTX;
     
    94101    m->print(out, nullptr);
    95102
    96     if (LLVM_UNLIKELY(codegen::DumpGeneratedIR))
     103    if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::ShowIR)))
    97104            m->dump();
    98105
     
    176183    setAllFeatures(builder);
    177184
    178     if (LLVM_UNLIKELY(codegen::DumpGeneratedIR)) {
     185    if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::ShowIR))) {
    179186        if (codegen::IROutputFilename.empty()) {
    180187            m->dump();
     
    186193    }
    187194#if LLVM_VERSION_MINOR > 6
    188     if (codegen::DumpASM) {
     195    if (codegen::DebugOptionIsSet(codegen::ShowASM)) {
    189196      WriteAssembly(builder.selectTarget(), m);
    190197    }
Note: See TracChangeset for help on using the changeset viewer.