| OLD | NEW |
| 1 //===- subzero/src/main.cpp - Driver for bitcode translation --------------===// | 1 //===- subzero/src/main.cpp - Driver for bitcode translation --------------===// |
| 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 for translating PNaCl bitcode into native code. | 10 // This file defines a driver for translating PNaCl bitcode into native code. |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 if (BuildOnRead) { | 379 if (BuildOnRead) { |
| 380 std::unique_ptr<Ice::PNaClTranslator> PTranslator( | 380 std::unique_ptr<Ice::PNaClTranslator> PTranslator( |
| 381 new Ice::PNaClTranslator(&Ctx)); | 381 new Ice::PNaClTranslator(&Ctx)); |
| 382 PTranslator->translate(IRFilename); | 382 PTranslator->translate(IRFilename); |
| 383 Translator.reset(PTranslator.release()); | 383 Translator.reset(PTranslator.release()); |
| 384 } else if (ALLOW_LLVM_IR) { | 384 } else if (ALLOW_LLVM_IR) { |
| 385 // Parse the input LLVM IR file into a module. | 385 // Parse the input LLVM IR file into a module. |
| 386 SMDiagnostic Err; | 386 SMDiagnostic Err; |
| 387 Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); | 387 Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); |
| 388 raw_ostream *Verbose = LLVMVerboseErrors ? &errs() : nullptr; | 388 raw_ostream *Verbose = LLVMVerboseErrors ? &errs() : nullptr; |
| 389 std::unique_ptr<Module> Mod = | 389 std::unique_ptr<Module> Mod = NaClParseIRFile( |
| 390 NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose, | 390 IRFilename, InputFileFormat, Err, Verbose, getGlobalContext()); |
| 391 getGlobalContext()); | |
| 392 if (!Mod) { | 391 if (!Mod) { |
| 393 Err.print(argv[0], errs()); | 392 Err.print(argv[0], errs()); |
| 394 return GetReturnValue(Ice::EC_Bitcode); | 393 return GetReturnValue(Ice::EC_Bitcode); |
| 395 } | 394 } |
| 396 | 395 |
| 397 std::unique_ptr<Ice::Converter> Converter( | 396 std::unique_ptr<Ice::Converter> Converter( |
| 398 new Ice::Converter(Mod.get(), &Ctx)); | 397 new Ice::Converter(Mod.get(), &Ctx)); |
| 399 Converter->convertToIce(); | 398 Converter->convertToIce(); |
| 400 Translator.reset(Converter.release()); | 399 Translator.reset(Converter.release()); |
| 401 } else { | 400 } else { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 416 if (SubzeroTimingEnabled) | 415 if (SubzeroTimingEnabled) |
| 417 Ctx.dumpTimers(); | 416 Ctx.dumpTimers(); |
| 418 if (TimeEachFunction) { | 417 if (TimeEachFunction) { |
| 419 const bool DumpCumulative = false; | 418 const bool DumpCumulative = false; |
| 420 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); | 419 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); |
| 421 } | 420 } |
| 422 const bool FinalStats = true; | 421 const bool FinalStats = true; |
| 423 Ctx.dumpStats("_FINAL_", FinalStats); | 422 Ctx.dumpStats("_FINAL_", FinalStats); |
| 424 return GetReturnValue(Ctx.getErrorStatus()->value()); | 423 return GetReturnValue(Ctx.getErrorStatus()->value()); |
| 425 } | 424 } |
| OLD | NEW |