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 | 768e5b1e9a6726af2728b55f177acdd124bce0a8 (patch) | |
tree | 28c2d99517de1e1cbd16bc9c28417f40abff4e2c /clang/lib/Serialization/ASTReaderDecl.cpp | |
parent | de95ead949726396f6e4ff17d3b88373124c23bc (diff) | |
download | bcm5719-llvm-768e5b1e9a6726af2728b55f177acdd124bce0a8.tar.gz bcm5719-llvm-768e5b1e9a6726af2728b55f177acdd124bce0a8.zip |
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.
llvm-svn: 147658
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 0672129f1e8..6a88313f743 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/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. |