| OLD | NEW |
| 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// | 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file defines a driver that uses LLVM capabilities to parse a | 10 // This file defines a driver that uses LLVM capabilities to parse a |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 static cl::opt<bool> | 165 static cl::opt<bool> |
| 166 BuildOnRead("build-on-read", | 166 BuildOnRead("build-on-read", |
| 167 cl::desc("Build ICE instructions when reading bitcode"), | 167 cl::desc("Build ICE instructions when reading bitcode"), |
| 168 cl::init(true)); | 168 cl::init(true)); |
| 169 | 169 |
| 170 static cl::opt<bool> AllowErrorRecovery( | 170 static cl::opt<bool> AllowErrorRecovery( |
| 171 "allow-pnacl-reader-error-recovery", | 171 "allow-pnacl-reader-error-recovery", |
| 172 cl::desc("Allow error recovery when reading PNaCl bitcode."), | 172 cl::desc("Allow error recovery when reading PNaCl bitcode."), |
| 173 cl::init(false)); | 173 cl::init(false)); |
| 174 | 174 |
| 175 // TODO(kschimpf) Remove once the emitter handles these cases. |
| 176 static cl::opt<bool> |
| 177 StubConstantCalls("stub-const-calls", |
| 178 cl::desc("Stub indirect calls to constants."), |
| 179 cl::init(false)); |
| 180 |
| 175 static cl::opt<bool> LLVMVerboseErrors( | 181 static cl::opt<bool> LLVMVerboseErrors( |
| 176 "verbose-llvm-parse-errors", | 182 "verbose-llvm-parse-errors", |
| 177 cl::desc("Print out more descriptive PNaCl bitcode parse errors when " | 183 cl::desc("Print out more descriptive PNaCl bitcode parse errors when " |
| 178 "building LLVM IR first"), | 184 "building LLVM IR first"), |
| 179 cl::init(false)); | 185 cl::init(false)); |
| 180 | 186 |
| 181 static cl::opt<bool> | 187 static cl::opt<bool> |
| 182 UseIntegratedAssembler("integrated-as", | 188 UseIntegratedAssembler("integrated-as", |
| 183 cl::desc("Use integrated assembler (default yes)"), | 189 cl::desc("Use integrated assembler (default yes)"), |
| 184 cl::init(true)); | 190 cl::init(true)); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; | 312 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; |
| 307 Flags.TimeEachFunction = TimeEachFunction; | 313 Flags.TimeEachFunction = TimeEachFunction; |
| 308 Flags.NumTranslationThreads = NumThreads; | 314 Flags.NumTranslationThreads = NumThreads; |
| 309 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; | 315 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; |
| 310 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; | 316 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; |
| 311 Flags.TimingFocusOn = TimingFocusOn; | 317 Flags.TimingFocusOn = TimingFocusOn; |
| 312 Flags.VerboseFocusOn = VerboseFocusOn; | 318 Flags.VerboseFocusOn = VerboseFocusOn; |
| 313 Flags.TranslateOnly = TranslateOnly; | 319 Flags.TranslateOnly = TranslateOnly; |
| 314 Flags.DisableIRGeneration = DisableIRGeneration; | 320 Flags.DisableIRGeneration = DisableIRGeneration; |
| 315 Flags.AllowErrorRecovery = AllowErrorRecovery; | 321 Flags.AllowErrorRecovery = AllowErrorRecovery; |
| 322 Flags.StubConstantCalls = StubConstantCalls; |
| 316 | 323 |
| 317 // Force -build-on-read=0 for .ll files. | 324 // Force -build-on-read=0 for .ll files. |
| 318 const std::string LLSuffix = ".ll"; | 325 const std::string LLSuffix = ".ll"; |
| 319 if (IRFilename.length() >= LLSuffix.length() && | 326 if (IRFilename.length() >= LLSuffix.length() && |
| 320 IRFilename.compare(IRFilename.length() - LLSuffix.length(), | 327 IRFilename.compare(IRFilename.length() - LLSuffix.length(), |
| 321 LLSuffix.length(), LLSuffix) == 0) | 328 LLSuffix.length(), LLSuffix) == 0) |
| 322 BuildOnRead = false; | 329 BuildOnRead = false; |
| 323 | 330 |
| 324 // With the ELF writer, use a raw_fd_ostream to allow seeking. | 331 // With the ELF writer, use a raw_fd_ostream to allow seeking. |
| 325 // Also don't buffer, otherwise it gets pretty slow. | 332 // Also don't buffer, otherwise it gets pretty slow. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 if (SubzeroTimingEnabled) | 411 if (SubzeroTimingEnabled) |
| 405 Ctx.dumpTimers(); | 412 Ctx.dumpTimers(); |
| 406 if (TimeEachFunction) { | 413 if (TimeEachFunction) { |
| 407 const bool DumpCumulative = false; | 414 const bool DumpCumulative = false; |
| 408 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); | 415 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); |
| 409 } | 416 } |
| 410 const bool FinalStats = true; | 417 const bool FinalStats = true; |
| 411 Ctx.dumpStats("_FINAL_", FinalStats); | 418 Ctx.dumpStats("_FINAL_", FinalStats); |
| 412 return GetReturnValue(Ctx.getErrorStatus()->value()); | 419 return GetReturnValue(Ctx.getErrorStatus()->value()); |
| 413 } | 420 } |
| OLD | NEW |