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 7879a11..cc2e5be 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -265,10 +265,10 @@ bool Module::fullModuleNameIs(ArrayRef<StringRef> nameParts) const {
}
OptionalDirectoryEntryRef Module::getEffectiveUmbrellaDir() const {
- if (Umbrella && Umbrella.is<FileEntryRef>())
- return Umbrella.get<FileEntryRef>().getDir();
- if (Umbrella && Umbrella.is<DirectoryEntryRef>())
- return Umbrella.get<DirectoryEntryRef>();
+ if (const auto *Hdr = std::get_if<FileEntryRef>(&Umbrella))
+ return Hdr->getDir();
+ if (const auto *Dir = std::get_if<DirectoryEntryRef>(&Umbrella))
+ return *Dir;
return std::nullopt;
}