From 570024a8d9b4a4aa4a35f077a0a65003dc7b71fe Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 5 Aug 2010 06:57:20 +0000 Subject: Implement #pragma GCC visibility. llvm-svn: 110315 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d2be5af..6338402 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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.1