Fix PNaCl bitcode to LLVM IR reader to match new API.
When LLVM 3.5 was merged, the handling of errors was broken. This
is being fixed in the CL listed below. This CL fixes Subzero's
call so that it will work with the CL listed below.
Relavant LLVM CL: https://codereview.chromium.org/770853002
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4006
R=jfb@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/775173002
diff --git a/src/llvm2ice.cpp b/src/llvm2ice.cpp
index 4caa6b8..92bb839 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -166,6 +166,14 @@
cl::desc("Build ICE instructions when reading bitcode"),
cl::init(true));
+
+static cl::opt<bool>
+LLVMVerboseErrors(
+ "verbose-llvm-parse-errors",
+ cl::desc("Print out more descriptive PNaCl bitcode parse errors when "
+ "building LLVM IR first"),
+ cl::init(false));
+
static cl::opt<bool>
UseIntegratedAssembler("integrated-as",
cl::desc("Use integrated assembler (default yes)"),
@@ -344,8 +352,10 @@
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
+ raw_ostream *Verbose = LLVMVerboseErrors ? &errs() : nullptr;
Module *Mod =
- NaClParseIRFile(IRFilename, InputFileFormat, Err, getGlobalContext());
+ NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose,
+ getGlobalContext());
if (!Mod) {
Err.print(argv[0], errs());