aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2024-09-25 10:36:44 -0700
committerGitHub <noreply@github.com>2024-09-25 10:36:44 -0700
commitb1aea98cfa357e23f4bb52232da5f41781f23bff (patch)
tree7fc6ae22d4317dfaafa1f01432265d566b89c67a /clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
parentabe0dd195a3b2630afdc5c1c233eb2a068b2d72f (diff)
downloadllvm-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/Tooling/DependencyScanning/ModuleDepCollector.cpp')
-rw-r--r--clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
index c775adc..677f426 100644
--- a/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
@@ -241,7 +241,7 @@ ModuleDepCollector::getInvocationAdjustedForModuleBuildWithoutOutputs(
ModuleMapInputKind);
auto CurrentModuleMapEntry =
- ScanInstance.getFileManager().getFile(Deps.ClangModuleMapFile);
+ ScanInstance.getFileManager().getOptionalFileRef(Deps.ClangModuleMapFile);
assert(CurrentModuleMapEntry && "module map file entry not found");
// Remove directly passed modulemap files. They will get added back if they
@@ -251,7 +251,8 @@ ModuleDepCollector::getInvocationAdjustedForModuleBuildWithoutOutputs(
auto DepModuleMapFiles = collectModuleMapFiles(Deps.ClangModuleDeps);
for (StringRef ModuleMapFile : Deps.ModuleMapFileDeps) {
// TODO: Track these as `FileEntryRef` to simplify the equality check below.
- auto ModuleMapEntry = ScanInstance.getFileManager().getFile(ModuleMapFile);
+ auto ModuleMapEntry =
+ ScanInstance.getFileManager().getOptionalFileRef(ModuleMapFile);
assert(ModuleMapEntry && "module map file entry not found");
// Don't report module maps describing eagerly-loaded dependency. This
@@ -299,7 +300,8 @@ llvm::DenseSet<const FileEntry *> ModuleDepCollector::collectModuleMapFiles(
ModuleDeps *MD = ModuleDepsByID.lookup(MID);
assert(MD && "Inconsistent dependency info");
// TODO: Track ClangModuleMapFile as `FileEntryRef`.
- auto FE = ScanInstance.getFileManager().getFile(MD->ClangModuleMapFile);
+ auto FE = ScanInstance.getFileManager().getOptionalFileRef(
+ MD->ClangModuleMapFile);
assert(FE && "Missing module map file that was previously found");
ModuleMapFiles.insert(*FE);
}