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

Unified Diff: tools/pnacl-benchmark/pnacl-benchmark.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-abicheck/pnacl-abicheck.cpp ('k') | tools/pnacl-llc/pnacl-llc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/pnacl-benchmark/pnacl-benchmark.cpp
diff --git a/tools/pnacl-benchmark/pnacl-benchmark.cpp b/tools/pnacl-benchmark/pnacl-benchmark.cpp
index 125c2a8bb800968446e916620b5360f4dd4c2617..f5721f1843df4a8bf1def52435a1226d1417c28d 100644
--- a/tools/pnacl-benchmark/pnacl-benchmark.cpp
+++ b/tools/pnacl-benchmark/pnacl-benchmark.cpp
@@ -45,6 +45,12 @@ InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
static cl::opt<unsigned>
NumRuns("num-runs", cl::desc("Number of runs"), cl::init(1));
+static cl::opt<bool>
+VerboseErrors(
+ "verbose-parse-errors",
+ cl::desc("Print out more descriptive PNaCl bitcode parse errors"),
+ cl::init(false));
+
/// Used in a lexical block to measure and report the block's execution time.
///
/// \param N block name
@@ -202,8 +208,9 @@ void BenchmarkIRParsing() {
{
TimingOperationBlock T("LLVM IR parsing", BufSize);
SMDiagnostic Err;
+ raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr;
Module *M = NaClParseIRFile(InputFilename, PNaClFormat,
- Err, getGlobalContext());
+ Err, Verbose, getGlobalContext());
if (!M) {
report_fatal_error("Unable to NaClParseIRFile");
« no previous file with comments | « tools/pnacl-abicheck/pnacl-abicheck.cpp ('k') | tools/pnacl-llc/pnacl-llc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698