diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2024-09-25 10:36:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 10:36:44 -0700 |
commit | b1aea98cfa357e23f4bb52232da5f41781f23bff (patch) | |
tree | 7fc6ae22d4317dfaafa1f01432265d566b89c67a /clang/lib/Lex/HeaderSearch.cpp | |
parent | abe0dd195a3b2630afdc5c1c233eb2a068b2d72f (diff) | |
download | llvm-b1aea98cfa357e23f4bb52232da5f41781f23bff.zip llvm-b1aea98cfa357e23f4bb52232da5f41781f23bff.tar.gz llvm-b1aea98cfa357e23f4bb52232da5f41781f23bff.tar.bz2 |
[clang] Make deprecations of some `FileManager` APIs formal (#110014)
Some `FileManager` APIs still return `{File,Directory}Entry` instead of
the preferred `{File,Directory}EntryRef`. These are documented to be
deprecated, but don't have the attribute that warns on their usage. This
PR marks them as such with `LLVM_DEPRECATED()` and replaces their usage
with the recommended counterparts. NFCI.
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 4914c10..8826ab4 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -227,7 +227,7 @@ std::string HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName, ".pcm"); else llvm::sys::path::append(Result, ModuleName + ".pcm"); - if (getFileMgr().getFile(Result.str())) + if (getFileMgr().getOptionalFileRef(Result)) return std::string(Result); } @@ -246,7 +246,7 @@ std::string HeaderSearch::getPrebuiltImplicitModuleFileName(Module *Module) { llvm::sys::path::append(CachePath, ModuleCacheHash); std::string FileName = getCachedModuleFileNameImpl(ModuleName, ModuleMapPath, CachePath); - if (!FileName.empty() && getFileMgr().getFile(FileName)) + if (!FileName.empty() && getFileMgr().getOptionalFileRef(FileName)) return FileName; } return {}; @@ -655,7 +655,7 @@ OptionalFileEntryRef DirectoryLookup::DoFrameworkLookup( ++NumFrameworkLookups; // If the framework dir doesn't exist, we fail. - auto Dir = FileMgr.getDirectory(FrameworkName); + auto Dir = FileMgr.getOptionalDirectoryRef(FrameworkName); if (!Dir) return std::nullopt; @@ -718,7 +718,7 @@ OptionalFileEntryRef DirectoryLookup::DoFrameworkLookup( bool FoundFramework = false; do { // Determine whether this directory exists. - auto Dir = FileMgr.getDirectory(FrameworkPath); + auto Dir = FileMgr.getOptionalDirectoryRef(FrameworkPath); if (!Dir) break; |