From 6e73cfa8363d43689f77b0e4e4c2787ae6ae3fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Duncan=20P=2E=20N=2E=20Exon=C2=A0Smith?= Date: Thu, 29 Oct 2020 15:14:30 -0400 Subject: 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 --- clang/lib/Basic/Module.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Basic/Module.cpp') 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(Umbrella)}; + return {UmbrellaAsWritten, Umbrella.dyn_cast()}; } void Module::addTopHeader(const FileEntry *File) { -- cgit v1.1