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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Note: While this flag isn't used in the minimal build, we keep this | 161 // Note: While this flag isn't used in the minimal build, we keep this |
162 // flag so that tests can set this command-line flag without concern | 162 // flag so that tests can set this command-line flag without concern |
163 // to the type of build. We double check that this flag at runtime | 163 // to the type of build. We double check that this flag at runtime |
164 // to make sure the consistency is maintained. | 164 // to make sure the consistency is maintained. |
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( |
| 171 "allow-pnacl-reader-error-recovery", |
| 172 cl::desc("Allow error recovery when reading PNaCl bitcode."), |
| 173 cl::init(false)); |
170 | 174 |
171 static cl::opt<bool> | 175 static cl::opt<bool> |
172 LLVMVerboseErrors( | 176 LLVMVerboseErrors( |
173 "verbose-llvm-parse-errors", | 177 "verbose-llvm-parse-errors", |
174 cl::desc("Print out more descriptive PNaCl bitcode parse errors when " | 178 cl::desc("Print out more descriptive PNaCl bitcode parse errors when " |
175 "building LLVM IR first"), | 179 "building LLVM IR first"), |
176 cl::init(false)); | 180 cl::init(false)); |
177 | 181 |
178 static cl::opt<bool> | 182 static cl::opt<bool> |
179 UseIntegratedAssembler("integrated-as", | 183 UseIntegratedAssembler("integrated-as", |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 Flags.DecorateAsm = DecorateAsm; | 294 Flags.DecorateAsm = DecorateAsm; |
291 Flags.DumpStats = DumpStats; | 295 Flags.DumpStats = DumpStats; |
292 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; | 296 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; |
293 Flags.TimeEachFunction = TimeEachFunction; | 297 Flags.TimeEachFunction = TimeEachFunction; |
294 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; | 298 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; |
295 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; | 299 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; |
296 Flags.TimingFocusOn = TimingFocusOn; | 300 Flags.TimingFocusOn = TimingFocusOn; |
297 Flags.VerboseFocusOn = VerboseFocusOn; | 301 Flags.VerboseFocusOn = VerboseFocusOn; |
298 Flags.TranslateOnly = TranslateOnly; | 302 Flags.TranslateOnly = TranslateOnly; |
299 Flags.DisableIRGeneration = DisableIRGeneration; | 303 Flags.DisableIRGeneration = DisableIRGeneration; |
| 304 Flags.AllowErrorRecovery = AllowErrorRecovery; |
300 | 305 |
301 // Force -build-on-read=0 for .ll files. | 306 // Force -build-on-read=0 for .ll files. |
302 const std::string LLSuffix = ".ll"; | 307 const std::string LLSuffix = ".ll"; |
303 if (IRFilename.length() >= LLSuffix.length() && | 308 if (IRFilename.length() >= LLSuffix.length() && |
304 IRFilename.compare(IRFilename.length() - LLSuffix.length(), | 309 IRFilename.compare(IRFilename.length() - LLSuffix.length(), |
305 LLSuffix.length(), LLSuffix) == 0) | 310 LLSuffix.length(), LLSuffix) == 0) |
306 BuildOnRead = false; | 311 BuildOnRead = false; |
307 | 312 |
308 // With the ELF writer, use a raw_fd_ostream to allow seeking. | 313 // With the ELF writer, use a raw_fd_ostream to allow seeking. |
309 // Also don't buffer, otherwise it gets pretty slow. | 314 // Also don't buffer, otherwise it gets pretty slow. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 if (SubzeroTimingEnabled) | 382 if (SubzeroTimingEnabled) |
378 Ctx.dumpTimers(); | 383 Ctx.dumpTimers(); |
379 if (TimeEachFunction) { | 384 if (TimeEachFunction) { |
380 const bool DumpCumulative = false; | 385 const bool DumpCumulative = false; |
381 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); | 386 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); |
382 } | 387 } |
383 const bool FinalStats = true; | 388 const bool FinalStats = true; |
384 Ctx.dumpStats("_FINAL_", FinalStats); | 389 Ctx.dumpStats("_FINAL_", FinalStats); |
385 return GetReturnValue(ErrorStatus); | 390 return GetReturnValue(ErrorStatus); |
386 } | 391 } |
OLD | NEW |