| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 Flags.DumpStats = DumpStats; | 277 Flags.DumpStats = DumpStats; |
| 278 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; | 278 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; |
| 279 Flags.TimeEachFunction = TimeEachFunction; | 279 Flags.TimeEachFunction = TimeEachFunction; |
| 280 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; | 280 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; |
| 281 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; | 281 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; |
| 282 Flags.TimingFocusOn = TimingFocusOn; | 282 Flags.TimingFocusOn = TimingFocusOn; |
| 283 Flags.VerboseFocusOn = VerboseFocusOn; | 283 Flags.VerboseFocusOn = VerboseFocusOn; |
| 284 Flags.TranslateOnly = TranslateOnly; | 284 Flags.TranslateOnly = TranslateOnly; |
| 285 Flags.DisableIRGeneration = DisableIRGeneration; | 285 Flags.DisableIRGeneration = DisableIRGeneration; |
| 286 | 286 |
| 287 // Force -build-on-read=0 for .ll files. |
| 288 const std::string LLSuffix = ".ll"; |
| 289 if (IRFilename.length() >= LLSuffix.length() && |
| 290 IRFilename.compare(IRFilename.length() - LLSuffix.length(), |
| 291 LLSuffix.length(), LLSuffix) == 0) |
| 292 BuildOnRead = false; |
| 293 |
| 287 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, | 294 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, |
| 288 Flags); | 295 Flags); |
| 289 | 296 |
| 290 Ice::TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx); | 297 Ice::TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx); |
| 291 | 298 |
| 292 int ErrorStatus = 0; | 299 int ErrorStatus = 0; |
| 293 if (BuildOnRead) { | 300 if (BuildOnRead) { |
| 294 Ice::PNaClTranslator Translator(&Ctx, Flags); | 301 Ice::PNaClTranslator Translator(&Ctx, Flags); |
| 295 Translator.translate(IRFilename); | 302 Translator.translate(IRFilename); |
| 296 ErrorStatus = Translator.getErrorStatus(); | 303 ErrorStatus = Translator.getErrorStatus(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 317 if (SubzeroTimingEnabled) | 324 if (SubzeroTimingEnabled) |
| 318 Ctx.dumpTimers(); | 325 Ctx.dumpTimers(); |
| 319 if (TimeEachFunction) { | 326 if (TimeEachFunction) { |
| 320 const bool DumpCumulative = false; | 327 const bool DumpCumulative = false; |
| 321 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); | 328 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); |
| 322 } | 329 } |
| 323 const bool FinalStats = true; | 330 const bool FinalStats = true; |
| 324 Ctx.dumpStats("_FINAL_", FinalStats); | 331 Ctx.dumpStats("_FINAL_", FinalStats); |
| 325 return GetReturnValue(ErrorStatus); | 332 return GetReturnValue(ErrorStatus); |
| 326 } | 333 } |
| OLD | NEW |