aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitHeaderSearch.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/Frontend/InitHeaderSearch.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/Frontend/InitHeaderSearch.cpp')
-rw-r--r--clang/lib/Frontend/InitHeaderSearch.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp
index d65d134..a56af5a 100644
--- a/clang/lib/Frontend/InitHeaderSearch.cpp
+++ b/clang/lib/Frontend/InitHeaderSearch.cpp
@@ -148,17 +148,17 @@ bool InitHeaderSearch::AddUnmappedPath(const Twine &Path, IncludeDirGroup Group,
}
// If the directory exists, add it.
- if (const DirectoryEntry *DE = FM.getDirectory(MappedPathStr)) {
+ if (auto DE = FM.getDirectory(MappedPathStr)) {
IncludePath.push_back(
- std::make_pair(Group, DirectoryLookup(DE, Type, isFramework)));
+ std::make_pair(Group, DirectoryLookup(*DE, Type, isFramework)));
return true;
}
// Check to see if this is an apple-style headermap (which are not allowed to
// be frameworks).
if (!isFramework) {
- if (const FileEntry *FE = FM.getFile(MappedPathStr)) {
- if (const HeaderMap *HM = Headers.CreateHeaderMap(FE)) {
+ if (auto FE = FM.getFile(MappedPathStr)) {
+ if (const HeaderMap *HM = Headers.CreateHeaderMap(*FE)) {
// It is a headermap, add it to the search path.
IncludePath.push_back(
std::make_pair(Group,
@@ -636,8 +636,8 @@ void clang::ApplyHeaderSearchOptions(HeaderSearch &HS,
// Set up the builtin include directory in the module map.
SmallString<128> P = StringRef(HSOpts.ResourceDir);
llvm::sys::path::append(P, "include");
- if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P))
- HS.getModuleMap().setBuiltinIncludeDir(Dir);
+ if (auto Dir = HS.getFileMgr().getDirectory(P))
+ HS.getModuleMap().setBuiltinIncludeDir(*Dir);
}
Init.Realize(Lang);