diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-31 14:53:11 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-06-15 12:34:54 +0200 |
commit | fa5788ff8dc10f36e0947757e335cd180a1a63c9 (patch) | |
tree | fbf8546f17263e3655ed5bc9310f1385daa0b5f1 /clang/lib/Basic/Module.cpp | |
parent | ed27d28f9a53d689c98a3bef26980e2858350548 (diff) | |
download | llvm-fa5788ff8dc10f36e0947757e335cd180a1a63c9.zip llvm-fa5788ff8dc10f36e0947757e335cd180a1a63c9.tar.gz llvm-fa5788ff8dc10f36e0947757e335cd180a1a63c9.tar.bz2 |
[clang][index] NFCI: Make `CXFile` a `FileEntryRef`
This patch swaps out the `void *` behind `CXFile` from `FileEntry *` to `FileEntryRef::MapEntry *`. This allows us to remove some deprecated uses of `FileEntry::getName()`.
Depends on D151854.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151938
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 057fc77..3f9b8d0 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -271,18 +271,16 @@ OptionalDirectoryEntryRef Module::getEffectiveUmbrellaDir() const { return std::nullopt; } -void Module::addTopHeader(const FileEntry *File) { +void Module::addTopHeader(FileEntryRef File) { assert(File); TopHeaders.insert(File); } -ArrayRef<const FileEntry *> Module::getTopHeaders(FileManager &FileMgr) { +ArrayRef<FileEntryRef> Module::getTopHeaders(FileManager &FileMgr) { if (!TopHeaderNames.empty()) { - for (std::vector<std::string>::iterator - I = TopHeaderNames.begin(), E = TopHeaderNames.end(); I != E; ++I) { - if (auto FE = FileMgr.getFile(*I)) + for (StringRef TopHeaderName : TopHeaderNames) + if (auto FE = FileMgr.getOptionalFileRef(TopHeaderName)) TopHeaders.insert(*FE); - } TopHeaderNames.clear(); } |