From 173a4f43a911175643bda81ee675e8d9269056ea Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 24 Nov 2014 09:15:30 +0000 Subject: 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 --- unittests/Tooling/RefactoringTest.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'unittests/Tooling/RefactoringTest.cpp') 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 FileBuffer( + Context.Files.getBufferForFile(Path, nullptr)); + return FileBuffer->getBuffer(); } llvm::StringMap TemporaryFiles; -- cgit v1.1