| 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 // 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::unique_ptr<Converter> Converter(new class Converter(Mod.get(), &Ctx)); | 134 std::unique_ptr<Converter> Converter(new class Converter(Mod.get(), &Ctx)); |
| 135 Converter->convertToIce(); | 135 Converter->convertToIce(); |
| 136 Translator.reset(Converter.release()); | 136 Translator.reset(Converter.release()); |
| 137 } else { | 137 } else { |
| 138 Ctx.getStrDump() << "Error: Build doesn't allow LLVM IR, " | 138 Ctx.getStrDump() << "Error: Build doesn't allow LLVM IR, " |
| 139 << "--build-on-read=0 not allowed\n"; | 139 << "--build-on-read=0 not allowed\n"; |
| 140 return Ctx.getErrorStatus()->assign(EC_Args); | 140 return Ctx.getErrorStatus()->assign(EC_Args); |
| 141 } | 141 } |
| 142 | 142 |
| 143 Ctx.waitForWorkerThreads(); | 143 Ctx.waitForWorkerThreads(); |
| 144 Translator->transferErrorCode(); | 144 if (Translator->getErrorStatus()) { |
| 145 Translator->emitConstants(); | 145 Ctx.getErrorStatus()->assign(Translator->getErrorStatus().value()); |
| 146 } else { |
| 147 Ctx.lowerGlobals("last"); |
| 148 Ctx.lowerProfileData(); |
| 149 Ctx.lowerConstants(); |
| 146 | 150 |
| 147 if (Ctx.getFlags().getOutFileType() == FT_Elf) { | 151 if (Ctx.getFlags().getOutFileType() == FT_Elf) { |
| 148 TimerMarker T1(Ice::TimerStack::TT_emit, &Ctx); | 152 TimerMarker T1(Ice::TimerStack::TT_emit, &Ctx); |
| 149 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); | 153 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); |
| 150 Ctx.getObjectWriter()->writeNonUserSections(); | 154 Ctx.getObjectWriter()->writeNonUserSections(); |
| 155 } |
| 151 } | 156 } |
| 157 |
| 152 if (Ctx.getFlags().getSubzeroTimingEnabled()) | 158 if (Ctx.getFlags().getSubzeroTimingEnabled()) |
| 153 Ctx.dumpTimers(); | 159 Ctx.dumpTimers(); |
| 160 |
| 154 if (Ctx.getFlags().getTimeEachFunction()) { | 161 if (Ctx.getFlags().getTimeEachFunction()) { |
| 155 const bool DumpCumulative = false; | 162 const bool DumpCumulative = false; |
| 156 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); | 163 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); |
| 157 } | 164 } |
| 158 const bool FinalStats = true; | 165 constexpr bool FinalStats = true; |
| 159 Ctx.dumpStats("_FINAL_", FinalStats); | 166 Ctx.dumpStats("_FINAL_", FinalStats); |
| 160 } | 167 } |
| 161 | 168 |
| 162 } // end of namespace Ice | 169 } // end of namespace Ice |
| OLD | NEW |