Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: src/IceCompiler.cpp

Issue 1961743002: Subzero: Update for LLVM 3.9 (trunk). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero@master
Patch Set: Remove unnecessary variable Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCompileServer.cpp ('k') | src/IceConverter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompiler.cpp
diff --git a/src/IceCompiler.cpp b/src/IceCompiler.cpp
index fbe05777d1b62cd43cf5ce8546b3baaf63a326c5..dcaeb0521841402b91efb84b8ea9b69057e36007 100644
--- a/src/IceCompiler.cpp
+++ b/src/IceCompiler.cpp
@@ -86,8 +86,13 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
const bool WasmBuildOnRead = Flags.getBuildOnRead() && wasmInput(IRFilename);
if (BuildOnRead) {
std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx));
+#ifdef PNACL_LLVM
std::unique_ptr<llvm::StreamingMemoryObject> MemObj(
new llvm::StreamingMemoryObjectImpl(InputStream.release()));
+#else // !PNACL_LLVM
+ std::unique_ptr<llvm::StreamingMemoryObject> MemObj(
+ new llvm::StreamingMemoryObject(std::move(InputStream)));
+#endif // !PNACL_LLVM
PTranslator->translate(IRFilename, std::move(MemObj));
Translator.reset(PTranslator.release());
} else if (WasmBuildOnRead) {
@@ -120,6 +125,7 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
// Parse the input LLVM IR file into a module.
llvm::SMDiagnostic Err;
TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
+#ifdef PNACL_LLVM
llvm::DiagnosticHandlerFunction DiagnosticHandler =
Flags.getLLVMVerboseErrors()
? redirectNaClDiagnosticToStream(llvm::errs())
@@ -127,6 +133,10 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
std::unique_ptr<llvm::Module> Mod =
NaClParseIRFile(IRFilename, Flags.getInputFileFormat(), Err,
llvm::getGlobalContext(), DiagnosticHandler);
+#else // !PNACL_LLVM
+ llvm::LLVMContext Context;
+ std::unique_ptr<llvm::Module> Mod = parseIRFile(IRFilename, Err, Context);
+#endif // !PNACL_LLVM
if (!Mod) {
Err.print(Flags.getAppName().c_str(), llvm::errs());
Ctx.getErrorStatus()->assign(EC_Bitcode);
« no previous file with comments | « src/IceCompileServer.cpp ('k') | src/IceConverter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698