diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /unittests/Tooling/RefactoringTest.cpp | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
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 8c7bfa1..ddb974a 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; |