aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-08-05 06:57:20 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-08-05 06:57:20 +0000
commitaa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 (patch)
tree0e384e8e18332ce359ebd014a89294db615176fa /lib/CodeGen/CodeGenModule.cpp
parentc133e9ea17d61062bcfb3bd6009c300c9a78161f (diff)
Implement #pragma GCC visibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index d2be5af14a..6338402579 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -190,9 +190,11 @@ CodeGenModule::getDeclVisibilityMode(const Decl *D) const {
return LangOptions::Hidden;
}
- // This decl should have the same visibility as its parent.
+ // If this decl is contained in a class, it should have the same visibility
+ // as the parent class.
if (const DeclContext *DC = D->getDeclContext())
- return getDeclVisibilityMode(cast<Decl>(DC));
+ if (DC->isRecord())
+ return getDeclVisibilityMode(cast<Decl>(DC));
return getLangOptions().getVisibilityMode();
}