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

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

Issue 1310883003: Install notion of diagnostic handler into PNaCl bitcode readers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix issues in patch set 2. Created 5 years, 4 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 | « tools/llvm-dis/llvm-dis.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-abicheck/pnacl-abicheck.cpp
diff --git a/tools/pnacl-abicheck/pnacl-abicheck.cpp b/tools/pnacl-abicheck/pnacl-abicheck.cpp
index ed326b5332495a42fae368d93626eeed4a07d2c5..1dbbbdf8bb854261b75c92c83e5d7d7a92b5d2b5 100644
--- a/tools/pnacl-abicheck/pnacl-abicheck.cpp
+++ b/tools/pnacl-abicheck/pnacl-abicheck.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/NaCl.h"
+#include "llvm/Bitcode/NaCl/NaClReaderWriter.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
@@ -70,9 +71,10 @@ int main(int argc, char **argv) {
if (Quiet)
VerboseErrors = false;
- raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr;
- std::unique_ptr<Module> Mod(
- NaClParseIRFile(InputFilename, InputFileFormat, Err, Verbose, Context));
+ DiagnosticHandlerFunction DiagnosticHandler =
+ VerboseErrors ? redirectNaClDiagnosticToStream(errs()) : nullptr;
+ std::unique_ptr<Module> Mod(NaClParseIRFile(InputFilename, InputFileFormat,
+ Err, Context, DiagnosticHandler));
if (Mod.get() == 0) {
Err.print(argv[0], errs());
return 1;
« no previous file with comments | « tools/llvm-dis/llvm-dis.cpp ('k') | tools/pnacl-llc/pnacl-llc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698