aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 2bdbe8d2..8ec6823 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -264,10 +264,10 @@ bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) 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 DirectoryEntryRef::MapEntry *>())
- return DirectoryEntryRef(*ME);
+ if (Umbrella && Umbrella.is<FileEntryRef>())
+ return Umbrella.get<FileEntryRef>().getDir();
+ if (Umbrella && Umbrella.is<DirectoryEntryRef>())
+ return Umbrella.get<DirectoryEntryRef>();
return std::nullopt;
}