Chromium Code Reviews| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 llvm::getGlobalContext(), DiagnosticHandler); | 107 llvm::getGlobalContext(), DiagnosticHandler); |
| 108 if (!Mod) { | 108 if (!Mod) { |
| 109 Err.print(Flags.getAppName().c_str(), llvm::errs()); | 109 Err.print(Flags.getAppName().c_str(), llvm::errs()); |
| 110 Ctx.getErrorStatus()->assign(EC_Bitcode); | 110 Ctx.getErrorStatus()->assign(EC_Bitcode); |
| 111 return; | 111 return; |
| 112 } | 112 } |
| 113 | 113 |
| 114 std::unique_ptr<Converter> Converter(new class Converter(Mod.get(), &Ctx)); | 114 std::unique_ptr<Converter> Converter(new class Converter(Mod.get(), &Ctx)); |
| 115 Converter->convertToIce(); | 115 Converter->convertToIce(); |
| 116 Translator.reset(Converter.release()); | 116 Translator.reset(Converter.release()); |
| 117 Ctx.waitForWorkerThreads(); | |
|
John
2016/03/24 17:32:34
I don't understand this change.
Karl
2016/03/24 17:37:49
For the bitcode reader, we must move this call ins
John
2016/03/24 17:44:00
ok, maybe add a comment here? I get nervous when I
Karl
2016/03/24 22:35:25
I looked at the code more carefully, and (due to p
| |
| 117 } else { | 118 } else { |
| 118 Ctx.getStrError() << "Error: Build doesn't allow LLVM IR, " | 119 Ctx.getStrError() << "Error: Build doesn't allow LLVM IR, " |
| 119 << "--build-on-read=0 not allowed\n"; | 120 << "--build-on-read=0 not allowed\n"; |
| 120 Ctx.getErrorStatus()->assign(EC_Args); | 121 Ctx.getErrorStatus()->assign(EC_Args); |
| 121 return; | 122 return; |
| 122 } | 123 } |
| 123 | 124 |
| 124 Ctx.waitForWorkerThreads(); | |
| 125 if (Translator->getErrorStatus()) { | 125 if (Translator->getErrorStatus()) { |
| 126 Ctx.getErrorStatus()->assign(Translator->getErrorStatus().value()); | 126 Ctx.getErrorStatus()->assign(Translator->getErrorStatus().value()); |
| 127 } else { | 127 } else { |
| 128 Ctx.lowerGlobals("last"); | 128 Ctx.lowerGlobals("last"); |
| 129 Ctx.lowerProfileData(); | 129 Ctx.lowerProfileData(); |
| 130 Ctx.lowerConstants(); | 130 Ctx.lowerConstants(); |
| 131 Ctx.lowerJumpTables(); | 131 Ctx.lowerJumpTables(); |
| 132 | 132 |
| 133 if (Ctx.getFlags().getOutFileType() == FT_Elf) { | 133 if (Ctx.getFlags().getOutFileType() == FT_Elf) { |
| 134 TimerMarker T1(Ice::TimerStack::TT_emitAsm, &Ctx); | 134 TimerMarker T1(Ice::TimerStack::TT_emitAsm, &Ctx); |
| 135 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); | 135 Ctx.getObjectWriter()->setUndefinedSyms(Ctx.getConstantExternSyms()); |
| 136 Ctx.getObjectWriter()->writeNonUserSections(); | 136 Ctx.getObjectWriter()->writeNonUserSections(); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 if (Ctx.getFlags().getSubzeroTimingEnabled()) | 140 if (Ctx.getFlags().getSubzeroTimingEnabled()) |
| 141 Ctx.dumpTimers(); | 141 Ctx.dumpTimers(); |
| 142 | 142 |
| 143 if (Ctx.getFlags().getTimeEachFunction()) { | 143 if (Ctx.getFlags().getTimeEachFunction()) { |
| 144 constexpr bool NoDumpCumulative = false; | 144 constexpr bool NoDumpCumulative = false; |
| 145 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); | 145 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); |
| 146 } | 146 } |
| 147 constexpr bool FinalStats = true; | 147 constexpr bool FinalStats = true; |
| 148 Ctx.dumpStats("_FINAL_", FinalStats); | 148 Ctx.dumpStats("_FINAL_", FinalStats); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // end of namespace Ice | 151 } // end of namespace Ice |
| OLD | NEW |