aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-10-29 15:14:30 -0400
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-11-04 16:19:39 -0500
commit6e73cfa8363d43689f77b0e4e4c2787ae6ae3fb6 (patch)
tree74c6deb6dea1457a335c5a45169ab691cd69e7e8 /clang/lib/Basic/Module.cpp
parentab0ddbc38af9508ee0f753fb897d9050025a0763 (diff)
downloadllvm-6e73cfa8363d43689f77b0e4e4c2787ae6ae3fb6.zip
llvm-6e73cfa8363d43689f77b0e4e4c2787ae6ae3fb6.tar.gz
llvm-6e73cfa8363d43689f77b0e4e4c2787ae6ae3fb6.tar.bz2
Basic: Change Module::Umbrella to a PointerUnion, NFC
Change `Module::Umbrella` from a `const void *` to a `PointerUnion` of `FileEntry` and `DirectoryEntry`. We can drop the `HasUmbrellaDir` bit (since `PointerUnion` includes that). This change makes it safer to update to `FileEntryRef` and `DirectoryEntryRef` in a future patch. Differential Revision: https://reviews.llvm.org/D90481
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r--clang/lib/Basic/Module.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 68c1d0f..8a8c400 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -44,7 +44,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
InferSubmodules(false), InferExplicitSubmodules(false),
InferExportWildcard(false), ConfigMacrosExhaustive(false),
NoUndeclaredIncludes(false), ModuleMapIsPrivate(false),
- HasUmbrellaDir(false), NameVisibility(Hidden) {
+ NameVisibility(Hidden) {
if (Parent) {
IsAvailable = Parent->isAvailable();
IsUnimportable = Parent->isUnimportable();
@@ -247,7 +247,7 @@ Module::DirectoryName Module::getUmbrellaDir() const {
if (Header U = getUmbrellaHeader())
return {"", U.Entry->getDir()};
- return {UmbrellaAsWritten, static_cast<const DirectoryEntry *>(Umbrella)};
+ return {UmbrellaAsWritten, Umbrella.dyn_cast<const DirectoryEntry *>()};
}
void Module::addTopHeader(const FileEntry *File) {