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/Frontend/CompilerInstance.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/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 5f2a963..240305b 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -427,12 +427,8 @@ static void InitializeFileRemapping(DiagnosticsEngine &Diags, } // Create the file entry for the file that we're mapping from. - const FileEntry *FromFile = - FileMgr.getVirtualFile(RF.first, ToFile->getSize(), 0); - if (!FromFile) { - Diags.Report(diag::err_fe_remap_missing_from_file) << RF.first; - continue; - } + FileEntryRef FromFile = + FileMgr.getVirtualFileRef(RF.first, ToFile->getSize(), 0); // Override the contents of the "from" file with the contents of // the "to" file. @@ -1926,7 +1922,7 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( // Check whether M refers to the file in the prebuilt module path. if (M && M->getASTFile()) - if (auto ModuleFile = FileMgr->getFile(ModuleFilename)) + if (auto ModuleFile = FileMgr->getOptionalFileRef(ModuleFilename)) if (*ModuleFile == M->getASTFile()) return M; |