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

Unified Diff: tools/pnacl-abicheck/pnacl-abicheck.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/llvm-nm/llvm-nm.cpp ('k') | tools/pnacl-benchmark/pnacl-benchmark.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/pnacl-abicheck/pnacl-abicheck.cpp
diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp
index d5c9a76c5a6562a55cd10ee30e2f3b1a3f27a192..6ec63ff8f8c0e112f388dfc8d670cdb5d80cf00e 100644
--- a/tools/pnacl-abicheck/pnacl-abicheck.cpp
+++ b/tools/pnacl-abicheck/pnacl-abicheck.cpp
@@ -29,6 +29,12 @@ static cl::opt<std::string>
InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
static cl::opt<bool>
+VerboseErrors(
+ "verbose-parse-errors",
+ cl::desc("Print out more descriptive PNaCl bitcode parse errors"),
+ cl::init(false));
+
+static cl::opt<bool>
Quiet("q", cl::desc("Do not print error messages"));
static cl::opt<NaClFileFormat>
@@ -61,8 +67,12 @@ int main(int argc, char **argv) {
SMDiagnostic Err;
cl::ParseCommandLineOptions(argc, argv, "PNaCl Bitcode ABI checker\n");
+ if (Quiet)
+ VerboseErrors = false;
+
+ raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr;
std::unique_ptr<Module> Mod(
- NaClParseIRFile(InputFilename, InputFileFormat, Err, Context));
+ NaClParseIRFile(InputFilename, InputFileFormat, Err, Verbose, Context));
if (Mod.get() == 0) {
Err.print(argv[0], errs());
return 1;
« no previous file with comments | « tools/llvm-nm/llvm-nm.cpp ('k') | tools/pnacl-benchmark/pnacl-benchmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698