From 39de84d671bac60662251e98f20a5a6039795dfc Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 7 Feb 2010 01:44:36 +0000 Subject: Improved handling of the visibility attribute. Declarations now inherit their parent's visibility. (This is kind of a risky change, but I did a self-host build and everything appears to work fine!) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95511 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 644c5d0bf8..c5d84d74db 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -132,6 +132,10 @@ CodeGenModule::getDeclVisibilityMode(const Decl *D) const { } } + // This decl should have the same visibility as its parent. + if (const DeclContext *DC = D->getDeclContext()) + return getDeclVisibilityMode(cast(DC)); + return getLangOptions().getVisibilityMode(); } -- cgit v1.2.3-70-g09d2