Modernize the .ll parsing interface.
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index d13caf1955e44e05088672143662e1052055503a..ef4f7ba272a352b5d2d57f9e1b8e7ae3b956d2bc 100644 (file)
@@ -21,6 +21,7 @@
 #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,8 +94,8 @@ 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;
   }