diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-26 13:14:16 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2023-05-26 15:30:28 -0700 |
commit | d6e617c8efab582121e0a0a9d539652bdfd544da (patch) | |
tree | 588ce41704d098199d0948236a411fabf70582e3 /clang/lib/Basic/Module.cpp | |
parent | 89d71c1efa85656b54bcd79b4278bc67690480e1 (diff) | |
download | llvm-d6e617c8efab582121e0a0a9d539652bdfd544da.zip llvm-d6e617c8efab582121e0a0a9d539652bdfd544da.tar.gz llvm-d6e617c8efab582121e0a0a9d539652bdfd544da.tar.bz2 |
[clang][modules] NFCI: Use `DirectoryEntryRef` for umbrella directory
This removes some deprecated uses of `DirectoryEntry::getName()`.
Depends on D151581.
Differential Revision: https://reviews.llvm.org/D151584
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index e0bce04..3df376a 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -263,12 +263,12 @@ bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const { return nameParts.empty(); } -const DirectoryEntry *Module::getEffectiveUmbrellaDir() const { +OptionalDirectoryEntryRef Module::getEffectiveUmbrellaDir() const { if (const auto *ME = Umbrella.dyn_cast<const FileEntryRef::MapEntry *>()) return FileEntryRef(*ME).getDir(); - if (const auto *ME = Umbrella.dyn_cast<const DirectoryEntry *>()) - return ME; - return nullptr; + if (const auto *ME = Umbrella.dyn_cast<const DirectoryEntryRef::MapEntry *>()) + return DirectoryEntryRef(*ME); + return std::nullopt; } void Module::addTopHeader(const FileEntry *File) { |