diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-07 01:44:36 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-07 01:44:36 +0000 |
commit | 10d369d1a22fdeaeb044b3db8a9126f71cb0c7ad (patch) | |
tree | 7a187c4f68e07b6ffdefc1a9b3701b26cc8c69e8 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | a7bcade22953fa390e95db0e4f7149a8532896e0 (diff) | |
download | bcm5719-llvm-10d369d1a22fdeaeb044b3db8a9126f71cb0c7ad.tar.gz bcm5719-llvm-10d369d1a22fdeaeb044b3db8a9126f71cb0c7ad.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 644c5d0bf8c..c5d84d74db8 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<Decl>(DC)); + return getLangOptions().getVisibilityMode(); } |