diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-06 16:22:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-06 16:22:39 +0000 |
commit | f143ffc4a9af79ac1d822fea6995af4bf45d17dc (patch) | |
tree | e13a13ef1f74e1e7da700f201c544eab49f0cde6 /lib/Serialization | |
parent | 9b8b20f7a4e2d2557fc49149ebd0df7a7b2c57dd (diff) |
Introduce a "Hidden" bit into Decl, to track whether that declaration
is hidden from name lookup. The previous hack of tweaking the
ModulePrivate bit when loading a declaration from a hidden submodule
was brittle.
Note that we now have 34 bits in Decl. I'll fix that next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 2 | ||||
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 2864fcf48b..df158599de 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -2496,7 +2496,7 @@ ASTReader::ASTReadResult ASTReader::validateFileEntries(ModuleFile &M) { void ASTReader::makeNamesVisible(const HiddenNames &Names) { for (unsigned I = 0, N = Names.size(); I != N; ++I) { if (Decl *D = Names[I].dyn_cast<Decl *>()) - D->ModulePrivate = false; + D->Hidden = false; else { IdentifierInfo *II = Names[I].get<IdentifierInfo *>(); if (!II->hasMacroDefinition()) { diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 0672129f1e..6a88313f74 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -364,7 +364,8 @@ void ASTDeclReader::VisitDecl(Decl *D) { D->setAccess((AccessSpecifier)Record[Idx++]); D->FromASTFile = true; D->ModulePrivate = Record[Idx++]; - + D->Hidden = D->ModulePrivate; + // Determine whether this declaration is part of a (sub)module. If so, it // may not yet be visible. if (unsigned SubmoduleID = readSubmoduleID(Record, Idx)) { @@ -372,9 +373,8 @@ void ASTDeclReader::VisitDecl(Decl *D) { if (!D->ModulePrivate) { if (Module *Owner = Reader.getSubmodule(SubmoduleID)) { if (Owner->NameVisibility != Module::AllVisible) { - // The owning module is not visible. Mark this declaration as - // module-private, - D->ModulePrivate = true; + // The owning module is not visible. Mark this declaration as hidden. + D->Hidden = true; // Note that this declaration was hidden because its owning module is // not yet visible. |