diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 17:02:24 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 17:02:24 +0000 |
commit | 2c8643c6396b0a3db33430cf9380e70bbb9efce0 (patch) | |
tree | 4df130b28021d86e13bf4565ef58c1c5a5e093b4 /contrib/llvm/tools/llvm-as/llvm-as.cpp | |
parent | 678318cd20f7db4e6c6b85d83fe00fa327b04fca (diff) | |
parent | e27feadae0885aa074df58ebfda2e7a7f7a7d590 (diff) | |
download | FreeBSD-src-2c8643c6396b0a3db33430cf9380e70bbb9efce0.zip FreeBSD-src-2c8643c6396b0a3db33430cf9380e70bbb9efce0.tar.gz |
Merge llvm 3.5.0 release from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
Diffstat (limited to 'contrib/llvm/tools/llvm-as/llvm-as.cpp')
-rw-r--r-- | contrib/llvm/tools/llvm-as/llvm-as.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/llvm/tools/llvm-as/llvm-as.cpp b/contrib/llvm/tools/llvm-as/llvm-as.cpp index b2e44ef..007241c 100644 --- a/contrib/llvm/tools/llvm-as/llvm-as.cpp +++ b/contrib/llvm/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; } } |