aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-as/llvm-as.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-as/llvm-as.cpp')
-rw-r--r--tools/llvm-as/llvm-as.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp
index b2e44ef..7583b12 100644
--- a/tools/llvm-as/llvm-as.cpp
+++ b/tools/llvm-as/llvm-as.cpp
@@ -16,10 +16,10 @@
//===----------------------------------------------------------------------===//
#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/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
@@ -69,8 +69,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 +93,19 @@ int main(int argc, char **argv) {
// Parse the file now...
SMDiagnostic Err;
- OwningPtr<Module> M(ParseAssemblyFile(InputFilename, Err, Context));
+ std::unique_ptr<Module> M(ParseAssemblyFile(InputFilename, Err, Context));
if (M.get() == 0) {
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;
}
}