aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/RefactoringTest.cpp
diff options
context:
space:
mode:
authorHarlan Haskins <harlan@harlanhaskins.com>2019-08-01 21:31:56 +0000
committerHarlan Haskins <harlan@harlanhaskins.com>2019-08-01 21:31:56 +0000
commit8d323d150610bed1feeb79d7a29c9958a4c8bcac (patch)
tree166514f9a8bba05ea1504afab5c319975a57675d /clang/unittests/Tooling/RefactoringTest.cpp
parent461f0722dd26487c1faa497ba37aabed1477a561 (diff)
downloadllvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.zip
llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.tar.gz
llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.tar.bz2
[clang] Adopt new FileManager error-returning APIs
Update the callers of FileManager::getFile and FileManager::getDirectory to handle the new llvm::ErrorOr-returning methods. Signed-off-by: Harlan Haskins <harlan@apple.com> llvm-svn: 367616
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r--clang/unittests/Tooling/RefactoringTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp
index c51d738..b04c9a9 100644
--- a/clang/unittests/Tooling/RefactoringTest.cpp
+++ b/clang/unittests/Tooling/RefactoringTest.cpp
@@ -608,14 +608,15 @@ public:
llvm::raw_fd_ostream OutStream(FD, true);
OutStream << Content;
OutStream.close();
- const FileEntry *File = Context.Files.getFile(Path);
- assert(File != nullptr);
+ auto File = Context.Files.getFile(Path);
+ assert(File);
StringRef Found =
TemporaryFiles.insert(std::make_pair(Name, Path.str())).first->second;
assert(Found == Path);
(void)Found;
- return Context.Sources.createFileID(File, SourceLocation(), SrcMgr::C_User);
+ return Context.Sources.createFileID(*File, SourceLocation(),
+ SrcMgr::C_User);
}
std::string getFileContentFromDisk(llvm::StringRef Name) {