aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderMap.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/lib/Lex/HeaderMap.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/lib/Lex/HeaderMap.cpp')
-rw-r--r--clang/lib/Lex/HeaderMap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp
index e0bf58b..7a46faf 100644
--- a/clang/lib/Lex/HeaderMap.cpp
+++ b/clang/lib/Lex/HeaderMap.cpp
@@ -204,7 +204,9 @@ const FileEntry *HeaderMap::LookupFile(
if (Dest.empty())
return nullptr;
- return FM.getFile(Dest);
+ if (auto File = FM.getFile(Dest))
+ return *File;
+ return nullptr;
}
StringRef HeaderMapImpl::lookupFilename(StringRef Filename,