diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-23 01:04:34 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-23 01:04:34 +0000 |
commit | 8f8ada1d408483feee9739b842838fd276cc2c1f (patch) | |
tree | 1d4cb48e94a358b2014b53f19c1678db67801af5 /lib/Sema/SemaLookup.cpp | |
parent | 20f171571be48643f23ce255c69c1c7a45aad161 (diff) |
PR33552: Distinguish between declarations that are owned by no module and
declarations that are owned but unconditionally visible.
This allows us to set declarations as visible even if they have a local owning
module, without losing information. In turn, that means that our Objective-C
support can keep on incorrectly assuming the "hidden" bit on the declaration is
the whole story with regard to name visibility. This will also be useful once
we support the C++ Modules TS export semantics.
Objective-C name visibility is still incorrect in any case where the "hidden"
bit is not the complete story: for instance, in Objective-C++ the set of
visible categories will be wrong during template instantiation, and with local
submodule visibility enabled it will be wrong when building modules. Fixing that
will require a major overhaul of how visibility is handled for Objective-C (and
particularly for categories).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306075 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 9f657a446c..2e7fb875a2 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1341,7 +1341,7 @@ void Sema::makeMergedDefinitionVisible(NamedDecl *ND) { Context.mergeDefinitionIntoModule(ND, M); else // We're not building a module; just make the definition visible. - ND->setHidden(false); + ND->setVisibleDespiteOwningModule(); // If ND is a template declaration, make the template parameters // visible too. They're not (necessarily) within a mergeable DeclContext. @@ -1528,7 +1528,7 @@ bool LookupResult::isVisibleSlow(Sema &SemaRef, NamedDecl *D) { !SemaRef.getLangOpts().ModulesLocalVisibility) { // Cache the fact that this declaration is implicitly visible because // its parent has a visible definition. - D->setHidden(false); + D->setVisibleDespiteOwningModule(); } return true; } |