diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /unittests/Tooling/RefactoringTest.cpp | |
parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) |
Notes
Diffstat (limited to 'unittests/Tooling/RefactoringTest.cpp')
-rw-r--r-- | unittests/Tooling/RefactoringTest.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/unittests/Tooling/RefactoringTest.cpp b/unittests/Tooling/RefactoringTest.cpp index 8c7bfa1c767a..ddb974ac9f4a 100644 --- a/unittests/Tooling/RefactoringTest.cpp +++ b/unittests/Tooling/RefactoringTest.cpp @@ -218,7 +218,7 @@ public: E = TemporaryFiles.end(); I != E; ++I) { llvm::StringRef Name = I->second; - llvm::error_code EC = llvm::sys::fs::remove(Name); + std::error_code EC = llvm::sys::fs::remove(Name); (void)EC; assert(!EC); } @@ -227,8 +227,7 @@ public: FileID createFile(llvm::StringRef Name, llvm::StringRef Content) { SmallString<1024> Path; int FD; - llvm::error_code EC = - llvm::sys::fs::createTemporaryFile(Name, "", FD, Path); + std::error_code EC = llvm::sys::fs::createTemporaryFile(Name, "", FD, Path); assert(!EC); (void)EC; @@ -236,7 +235,7 @@ public: OutStream << Content; OutStream.close(); const FileEntry *File = Context.Files.getFile(Path); - assert(File != NULL); + assert(File != nullptr); StringRef Found = TemporaryFiles.GetOrCreateValue(Name, Path.str()).second; assert(Found == Path); @@ -252,7 +251,9 @@ public: // descriptor, which might not see the changes made. // FIXME: Figure out whether there is a way to get the SourceManger to // reopen the file. - return Context.Files.getBufferForFile(Path, NULL)->getBuffer(); + std::unique_ptr<const llvm::MemoryBuffer> FileBuffer( + Context.Files.getBufferForFile(Path, nullptr)); + return FileBuffer->getBuffer(); } llvm::StringMap<std::string> TemporaryFiles; |