diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:08:18 +0000 |
commit | 5ca98fd98791947eba83a1ed3f2c8191ef7afa6c (patch) | |
tree | f5944309621cee4fe0976be6f9ac619b7ebfc4c2 /tools/llvm-as/llvm-as.cpp | |
parent | 68bcb7db193e4bc81430063148253d30a791023e (diff) |
Notes
Diffstat (limited to 'tools/llvm-as/llvm-as.cpp')
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index b2e44ef9d346..007241c5068d 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/tools/llvm-as/llvm-as.cpp @@ -16,11 +16,12 @@ //===----------------------------------------------------------------------===// #include "llvm/IR/LLVMContext.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Assembly/Parser.h" +#include "llvm/AsmParser/Parser.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/IR/Module.h" +#include "llvm/IR/Verifier.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Signals.h" @@ -69,8 +70,8 @@ static void WriteOutputFile(const Module *M) { } std::string ErrorInfo; - OwningPtr<tool_output_file> Out(new tool_output_file( - OutputFilename.c_str(), ErrorInfo, sys::fs::F_Binary)); + 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'; exit(1); @@ -93,18 +94,19 @@ int main(int argc, char **argv) { // Parse the file now... SMDiagnostic Err; - OwningPtr<Module> M(ParseAssemblyFile(InputFilename, Err, Context)); - if (M.get() == 0) { + std::unique_ptr<Module> M(ParseAssemblyFile(InputFilename, Err, Context)); + if (!M.get()) { Err.print(argv[0], errs()); return 1; } if (!DisableVerify) { - std::string Err; - if (verifyModule(*M.get(), ReturnStatusAction, &Err)) { + std::string ErrorStr; + raw_string_ostream OS(ErrorStr); + if (verifyModule(*M.get(), &OS)) { errs() << argv[0] << ": assembly parsed, but does not verify as correct!\n"; - errs() << Err; + errs() << OS.str(); return 1; } } |