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

Unified Diff: tools/pnacl-thaw/pnacl-thaw.cpp

Issue 770853002: Fix error reporting in the PNaCl bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix typo. Created 6 years 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 | « tools/pnacl-llc/pnacl-llc.cpp ('k') | unittests/Bitcode/CMakeLists.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/pnacl-thaw/pnacl-thaw.cpp
diff --git a/tools/pnacl-thaw/pnacl-thaw.cpp b/tools/pnacl-thaw/pnacl-thaw.cpp
index ef252ceab52f8c2c3adee61149f78327b0c5fa66..10fb2f4c5274a2d93e26b6500ff2e777853830f3 100644
--- a/tools/pnacl-thaw/pnacl-thaw.cpp
+++ b/tools/pnacl-thaw/pnacl-thaw.cpp
@@ -33,6 +33,12 @@ OutputFilename("o", cl::desc("Specify thawed pexe filename"),
static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<frozen file>"), cl::init("-"));
+static cl::opt<bool>
+VerboseErrors(
+ "verbose-parse-errors",
+ cl::desc("Print out more descriptive PNaCl bitcode parse errors"),
+ cl::init(false));
+
static void WriteOutputFile(const Module *M) {
std::string ErrorInfo;
@@ -73,8 +79,10 @@ int main(int argc, char **argv) {
DisplayFilename = "<stdin>";
else
DisplayFilename = InputFilename;
+ raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr;
M.reset(getNaClStreamedBitcodeModule(DisplayFilename, Buffer.release(),
- Context, &ErrorMessage,
+ Context, Verbose,
+ &ErrorMessage,
/*AcceptSupportedOnly=*/false));
if (M.get())
if (std::error_code EC = M->materializeAllPermanently()) {
« no previous file with comments | « tools/pnacl-llc/pnacl-llc.cpp ('k') | unittests/Bitcode/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698