From aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 5 Aug 2010 06:57:20 +0000 Subject: Implement #pragma GCC visibility. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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(DC)); + if (DC->isRecord()) + return getDeclVisibilityMode(cast(DC)); return getLangOptions().getVisibilityMode(); } -- cgit v1.2.3-18-g5258