Use std::error_code instead of llvm::error_code.
[oota-llvm.git] / unittests / Transforms / DebugIR / DebugIR.cpp
index 8b4f158bff3f52444dc4c59057421b2155579e51..5860e31b9d721b76b4df1ff209d9204ca5570632 100644 (file)
@@ -15,8 +15,8 @@
 #include "llvm/ADT/Triple.h"
 #include "../lib/Transforms/Instrumentation/DebugIR.h"
 #include "llvm/Config/config.h"
-#include "llvm/DebugInfo.h"
 #include "llvm/IR/DIBuilder.h"
+#include "llvm/IR/DebugInfo.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
@@ -58,14 +58,14 @@ bool removeIfExists(StringRef Path) {
   // This is an approximation, on error we don't know in general if the file
   // existed or not.
   llvm::error_code EC = sys::fs::remove(Path, false);
-  return EC != llvm::errc::no_such_file_or_directory;
+  return EC != std::errc::no_such_file_or_directory;
 }
 
 char * current_dir() {
 #if defined(LLVM_ON_WIN32) || defined(HAVE_GETCWD)
   // calling getcwd (or _getcwd() on windows) with a null buffer makes it
   // allocate a sufficiently sized buffer to store the current working dir.
-  return getcwd_impl(0, 0);
+  return getcwd_impl(nullptr, 0);
 #else
   return 0;
 #endif
@@ -90,8 +90,8 @@ protected:
 
   LLVMContext Context;
   char *cwd;
-  OwningPtr<Module> M;
-  OwningPtr<DebugIR> D;
+  std::unique_ptr<Module> M;
+  std::unique_ptr<DebugIR> D;
 };
 
 // Test empty named Module that is not supposed to be output to disk.
@@ -278,7 +278,7 @@ TEST_F(TestDebugIR, ExistingMetadataRetained) {
   // verify DebugIR did not generate a file
   ASSERT_FALSE(removeIfExists(Path)) << "Unexpected file " << Path;
 
-  DICompileUnit CU(*Finder.compile_unit_begin());
+  DICompileUnit CU(*Finder.compile_units().begin());
 
   // Verify original CU information is retained
   ASSERT_EQ(Filename, CU.getFilename());