Index: tools/pnacl-freeze/pnacl-freeze.cpp |
diff --git a/tools/pnacl-freeze/pnacl-freeze.cpp b/tools/pnacl-freeze/pnacl-freeze.cpp |
index ebe96048ffadcaff2ad2b3a32e0d978393257652..3899c8e1c09238af7b8bd4665987f7d6327acacb 100644 |
--- a/tools/pnacl-freeze/pnacl-freeze.cpp |
+++ b/tools/pnacl-freeze/pnacl-freeze.cpp |
@@ -21,7 +21,7 @@ |
#include "llvm/Support/ManagedStatic.h" |
#include "llvm/Support/PrettyStackTrace.h" |
#include "llvm/Support/Signals.h" |
-#include "llvm/Support/StreamableMemoryObject.h" |
+#include "llvm/Support/StreamingMemoryObject.h" |
#include "llvm/Support/ToolOutputFile.h" |
using namespace llvm; |
@@ -36,11 +36,11 @@ InputFilename(cl::Positional, cl::desc("<pexe file>"), cl::init("-")); |
static void WriteOutputFile(const Module *M) { |
- std::string ErrorInfo; |
+ std::error_code EC; |
std::unique_ptr<tool_output_file> Out( |
- new tool_output_file(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None)); |
- if (!ErrorInfo.empty()) { |
- errs() << ErrorInfo << '\n'; |
+ new tool_output_file(OutputFilename, EC, sys::fs::F_None)); |
+ if (EC) { |
+ errs() << EC.message() << '\n'; |
exit(1); |
} |