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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 !wasmInput(IRFilename); | 85 !wasmInput(IRFilename); |
| 86 const bool WasmBuildOnRead = Flags.getBuildOnRead() && wasmInput(IRFilename); | 86 const bool WasmBuildOnRead = Flags.getBuildOnRead() && wasmInput(IRFilename); |
| 87 if (BuildOnRead) { | 87 if (BuildOnRead) { |
| 88 std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx)); | 88 std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx)); |
| 89 std::unique_ptr<llvm::StreamingMemoryObject> MemObj( | 89 std::unique_ptr<llvm::StreamingMemoryObject> MemObj( |
| 90 new llvm::StreamingMemoryObjectImpl(InputStream.release())); | 90 new llvm::StreamingMemoryObjectImpl(InputStream.release())); |
| 91 PTranslator->translate(IRFilename, std::move(MemObj)); | 91 PTranslator->translate(IRFilename, std::move(MemObj)); |
| 92 Translator.reset(PTranslator.release()); | 92 Translator.reset(PTranslator.release()); |
| 93 } else if (WasmBuildOnRead) { | 93 } else if (WasmBuildOnRead) { |
| 94 if (BuildDefs::wasm()) { | 94 if (BuildDefs::wasm()) { |
| 95 #if !ALLOW_WASM | |
|
Jim Stichnoth
2016/04/05 13:10:41
I'm surprised this is necessary, because of BuildD
John
2016/04/05 13:14:08
the if(constexpr) guard is "weaker" than an #if. T
Jim Stichnoth
2016/04/05 13:18:38
Oh, right, I forgot about the fact that this code
| |
| 96 assert(false && "wasm not allowed"); | |
| 97 #else | |
| 95 std::unique_ptr<WasmTranslator> WTranslator(new WasmTranslator(&Ctx)); | 98 std::unique_ptr<WasmTranslator> WTranslator(new WasmTranslator(&Ctx)); |
| 96 | 99 |
| 97 WTranslator->translate(IRFilename, std::move(InputStream)); | 100 WTranslator->translate(IRFilename, std::move(InputStream)); |
| 98 | 101 |
| 99 Translator.reset(WTranslator.release()); | 102 Translator.reset(WTranslator.release()); |
| 103 #endif // !ALLOW_WASM | |
| 100 } else { | 104 } else { |
| 101 Ctx.getStrError() << "WASM support not enabled\n"; | 105 Ctx.getStrError() << "WASM support not enabled\n"; |
| 102 Ctx.getErrorStatus()->assign(EC_Args); | 106 Ctx.getErrorStatus()->assign(EC_Args); |
| 103 return; | 107 return; |
| 104 } | 108 } |
| 105 } else if (BuildDefs::llvmIr()) { | 109 } else if (BuildDefs::llvmIr()) { |
| 106 if (BuildDefs::browser()) { | 110 if (BuildDefs::browser()) { |
| 107 Ctx.getStrError() | 111 Ctx.getStrError() |
| 108 << "non BuildOnRead is not supported w/ PNACL_BROWSER_TRANSLATOR\n"; | 112 << "non BuildOnRead is not supported w/ PNACL_BROWSER_TRANSLATOR\n"; |
| 109 Ctx.getErrorStatus()->assign(EC_Args); | 113 Ctx.getErrorStatus()->assign(EC_Args); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 Ctx.dumpTimers(); | 165 Ctx.dumpTimers(); |
| 162 | 166 |
| 163 if (getFlags().getTimeEachFunction()) { | 167 if (getFlags().getTimeEachFunction()) { |
| 164 constexpr bool NoDumpCumulative = false; | 168 constexpr bool NoDumpCumulative = false; |
| 165 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); | 169 Ctx.dumpTimers(GlobalContext::TSK_Funcs, NoDumpCumulative); |
| 166 } | 170 } |
| 167 Ctx.dumpStats(); | 171 Ctx.dumpStats(); |
| 168 } | 172 } |
| 169 | 173 |
| 170 } // end of namespace Ice | 174 } // end of namespace Ice |
| OLD | NEW |