summaryrefslogtreecommitdiff
path: root/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
commit43696f88090b4e80468c1f91161767a7a7c43db9 (patch)
tree30df11f21f724050a17521406fe5b3b57c16bc49 /unittests/Tooling/RefactoringTest.cpp
parent2b41d1ddfc16bbd20185dd4a5847066b6299feeb (diff)
downloadclang-43696f88090b4e80468c1f91161767a7a7c43db9.tar.gz
[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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling/RefactoringTest.cpp')
-rw-r--r--unittests/Tooling/RefactoringTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/unittests/Tooling/RefactoringTest.cpp b/unittests/Tooling/RefactoringTest.cpp
index c51d738ba6..b04c9a91ef 100644
--- a/unittests/Tooling/RefactoringTest.cpp
+++ b/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) {