Changeset 5745 for icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp
- Timestamp:
- Nov 26, 2017, 12:09:25 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp
r5738 r5745 23 23 24 24 static cl::bits<DebugFlags> 25 DebugOptions(cl::values(clEnumVal(ShowUnoptimizedIR, "Print generated LLVM IR."), 26 clEnumVal(ShowIR, "Print optimized LLVM IR."), 27 clEnumVal(VerifyIR, "Run the IR verification pass."), 28 #if LLVM_VERSION_INTEGER >= LLVM_3_7_0 29 clEnumVal(ShowASM, "Print assembly code."), 30 #endif 25 DebugOptions(cl::values(clEnumVal(VerifyIR, "Run the IR verification pass."), 31 26 clEnumVal(SerializeThreads, "Force segment threads to run sequentially."), 32 27 clEnumVal(TraceCounts, "Show kernel processed and produced item counts."), … … 36 31 CL_ENUM_VAL_SENTINEL), cl::cat(CodeGenOptions)); 37 32 38 static cl::opt<std::string> IROutputFilenameOption("dump-generated-IR-output", cl::init(""), 39 cl::desc("output IR filename"), cl::cat(CodeGenOptions)); 33 std::string ShowIROption = OmittedOption; 34 static cl::opt<std::string, true> IROutputOption("ShowIR", cl::location(ShowIROption), cl::ValueOptional, 35 cl::desc("Print optimized LLVM IR to stderr (by omitting =<filename>) or a file"), cl::value_desc("filename"), cl::cat(CodeGenOptions)); 36 37 std::string ShowUnoptimizedIROption = OmittedOption; 38 static cl::opt<std::string, true> UnoptimizedIROutputOption("ShowUnoptimizedIR", cl::location(ShowUnoptimizedIROption), cl::ValueOptional, 39 cl::desc("Print generated LLVM IR to stderr (by omitting =<filename> or a file"), cl::value_desc("filename"), cl::cat(CodeGenOptions)); 40 40 41 41 #if LLVM_VERSION_INTEGER >= LLVM_3_7_0 42 static cl::opt<std::string> ASMOutputFilenameOption("asm-output", cl::init(""), 43 cl::desc("output ASM filename"), cl::cat(CodeGenOptions)); 44 45 static cl::opt<bool> AsmVerbose("asm-verbose", cl::init(true), 46 cl::desc("Add comments to directives."), cl::cat(CodeGenOptions)); 42 std::string ShowASMOption = OmittedOption; 43 static cl::opt<std::string, true> ASMOutputFilenameOption("ShowASM", cl::location(ShowASMOption), cl::ValueOptional, 44 cl::desc("Print generated assembly code to stderr (by omitting =<filename> or a file"), cl::value_desc("filename"), cl::cat(CodeGenOptions)); 47 45 #endif 48 46 … … 90 88 91 89 bool SegmentPipelineParallel; 92 93 const char * ASMOutputFilename;94 95 const char * IROutputFilename;96 90 97 91 const char * ObjectCacheDir; … … 160 154 #endif 161 155 cl::ParseCommandLineOptions(argc, argv); 162 if (DebugOptions.getBits() ) {156 if (DebugOptions.getBits() || (ShowIROption != OmittedOption) || (ShowUnoptimizedIROption != OmittedOption) || (ShowASMOption != OmittedOption)) { 163 157 EnableObjectCache = false; 164 158 } 165 159 ObjectCacheDir = ObjectCacheDirOption.empty() ? nullptr : ObjectCacheDirOption.data(); 166 IROutputFilename = IROutputFilenameOption.empty() ? nullptr : IROutputFilenameOption.data();167 ASMOutputFilename = ASMOutputFilenameOption.empty() ? nullptr : ASMOutputFilenameOption.data();168 160 Options = InitTargetOptionsFromCodeGenFlags(); 169 161 #if LLVM_VERSION_INTEGER >= LLVM_3_7_0 170 Options.MCOptions.AsmVerbose = AsmVerbose;162 Options.MCOptions.AsmVerbose = true; 171 163 #endif 172 164 switch (OptLevelOption) {
Note: See TracChangeset
for help on using the changeset viewer.