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

Unified Diff: tools/pnacl-thaw/pnacl-thaw.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/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 68e08a1ea50ce3b43cd673369d8ed78174d3ffd6..5adebdebea0cbd21d3b55afd287e3d4ee2a50e25 100644
--- a/tools/pnacl-thaw/pnacl-thaw.cpp
+++ b/tools/pnacl-thaw/pnacl-thaw.cpp
@@ -35,12 +35,6 @@ 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::error_code EC;
@@ -57,9 +51,8 @@ static void WriteOutputFile(const Module *M) {
Out->keep();
}
-static Module *readBitcode(
- std::string &Filename, LLVMContext &Context, raw_ostream *Verbose,
- std::string &ErrorMessage) {
+static Module *readBitcode(std::string &Filename, LLVMContext &Context,
+ std::string &ErrorMessage) {
// Use the bitcode streaming interface
DataStreamer *Streamer = getDataFileStreamer(InputFilename, &ErrorMessage);
if (Streamer == nullptr)
@@ -71,10 +64,10 @@ static Module *readBitcode(
DisplayFilename = "<stdin>";
else
DisplayFilename = Filename;
- Module *M = getNaClStreamedBitcodeModule(DisplayFilename, Buffer.release(),
- Context, Verbose,
- &ErrorMessage,
- /*AcceptSupportedOnly=*/false);
+ DiagnosticHandlerFunction DiagnosticHandler = nullptr;
+ Module *M = getNaClStreamedBitcodeModule(
+ DisplayFilename, Buffer.release(), Context, DiagnosticHandler,
+ &ErrorMessage, /*AcceptSupportedOnly=*/false);
if (!M)
return nullptr;
if (std::error_code EC = M->materializeAllPermanently()) {
@@ -99,9 +92,7 @@ int main(int argc, char **argv) {
argc, argv, "Converts NaCl pexe wire format into LLVM bitcode format\n");
std::string ErrorMessage;
- raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr;
- std::unique_ptr<Module> M(readBitcode(InputFilename, Context,
- Verbose, ErrorMessage));
+ std::unique_ptr<Module> M(readBitcode(InputFilename, Context, ErrorMessage));
if (!M.get()) {
errs() << argv[0] << ": ";
« 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