OLD | NEW |
1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// | 1 //===- subzero/src/IceCompiler.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 /// \file | 10 /// \file |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 new llvm::StreamingMemoryObjectImpl(InputStream.release())); | 86 new llvm::StreamingMemoryObjectImpl(InputStream.release())); |
87 PTranslator->translate(IRFilename, std::move(MemObj)); | 87 PTranslator->translate(IRFilename, std::move(MemObj)); |
88 Translator.reset(PTranslator.release()); | 88 Translator.reset(PTranslator.release()); |
89 } else if (BuildDefs::llvmIr()) { | 89 } else if (BuildDefs::llvmIr()) { |
90 if (BuildDefs::browser()) { | 90 if (BuildDefs::browser()) { |
91 Ctx.getStrError() | 91 Ctx.getStrError() |
92 << "non BuildOnRead is not supported w/ PNACL_BROWSER_TRANSLATOR\n"; | 92 << "non BuildOnRead is not supported w/ PNACL_BROWSER_TRANSLATOR\n"; |
93 Ctx.getErrorStatus()->assign(EC_Args); | 93 Ctx.getErrorStatus()->assign(EC_Args); |
94 return; | 94 return; |
95 } | 95 } |
| 96 // Globals must be kept alive after lowering when converting from LLVM to |
| 97 // Ice. |
| 98 Ctx.setDisposeGlobalVariablesAfterLowering(false); |
96 // Parse the input LLVM IR file into a module. | 99 // Parse the input LLVM IR file into a module. |
97 llvm::SMDiagnostic Err; | 100 llvm::SMDiagnostic Err; |
98 TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); | 101 TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); |
99 llvm::DiagnosticHandlerFunction DiagnosticHandler = | 102 llvm::DiagnosticHandlerFunction DiagnosticHandler = |
100 ExtraFlags.getLLVMVerboseErrors() | 103 ExtraFlags.getLLVMVerboseErrors() |
101 ? redirectNaClDiagnosticToStream(llvm::errs()) | 104 ? redirectNaClDiagnosticToStream(llvm::errs()) |
102 : nullptr; | 105 : nullptr; |
103 std::unique_ptr<llvm::Module> Mod = | 106 std::unique_ptr<llvm::Module> Mod = |
104 NaClParseIRFile(IRFilename, ExtraFlags.getInputFileFormat(), Err, | 107 NaClParseIRFile(IRFilename, ExtraFlags.getInputFileFormat(), Err, |
105 llvm::getGlobalContext(), DiagnosticHandler); | 108 llvm::getGlobalContext(), DiagnosticHandler); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 143 |
141 if (Ctx.getFlags().getTimeEachFunction()) { | 144 if (Ctx.getFlags().getTimeEachFunction()) { |
142 constexpr bool DumpCumulative = false; | 145 constexpr bool DumpCumulative = false; |
143 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); | 146 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); |
144 } | 147 } |
145 constexpr bool FinalStats = true; | 148 constexpr bool FinalStats = true; |
146 Ctx.dumpStats("_FINAL_", FinalStats); | 149 Ctx.dumpStats("_FINAL_", FinalStats); |
147 } | 150 } |
148 | 151 |
149 } // end of namespace Ice | 152 } // end of namespace Ice |
OLD | NEW |