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

Unified Diff: src/llvm2ice.cpp

Issue 897873004: Changes to rebase Subzero to LLVM 223109 APIs. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/llvm2ice.cpp
diff --git a/src/llvm2ice.cpp b/src/llvm2ice.cpp
index a98c75d327cf75af67c07711e3c13237f7ec30f1..f23f817494ca8adcd0be16e9601bddcf5c3781a6 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -18,6 +18,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
@@ -331,13 +332,13 @@ int main(int argc, char **argv) {
*Ls << "Error: writing binary ELF to stdout is unsupported\n";
return GetReturnValue(Ice::EC_Args);
}
- std::string ErrorInfo;
+ std::error_code EC;
raw_fd_ostream *FdOs =
- new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, sys::fs::F_None);
+ new raw_fd_ostream(OutputFilename, EC, sys::fs::F_None);
Os.reset(FdOs);
- if (!ErrorInfo.empty()) {
+ if (EC) {
*Ls << "Failed to open output file: " << OutputFilename << ":\n"
- << ErrorInfo << "\n";
+ << EC.message() << "\n";
return GetReturnValue(Ice::EC_Args);
}
ELFStr.reset(new Ice::ELFStreamer(*FdOs));
@@ -374,16 +375,16 @@ int main(int argc, char **argv) {
SMDiagnostic Err;
Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
raw_ostream *Verbose = LLVMVerboseErrors ? &errs() : nullptr;
- Module *Mod = NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose,
- getGlobalContext());
-
+ std::unique_ptr<Module> Mod =
+ NaClParseIRFile(IRFilename, InputFileFormat, Err, Verbose,
+ getGlobalContext());
if (!Mod) {
Err.print(argv[0], errs());
return GetReturnValue(Ice::EC_Bitcode);
}
std::unique_ptr<Ice::Converter> Converter(
- new Ice::Converter(Mod, &Ctx, Flags));
+ new Ice::Converter(Mod.get(), &Ctx, Flags));
Converter->convertToIce();
Translator.reset(Converter.release());
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698