From 10d369d1a22fdeaeb044b3db8a9126f71cb0c7ad 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!) llvm-svn: 95511 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 644c5d0..c5d84d7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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.1