]> granicus.if.org Git - clang/commitdiff
do not set visibility on "private" or "available externally" linkage objects.
authorChris Lattner <sabre@nondot.org>
Tue, 14 Apr 2009 05:27:13 +0000 (05:27 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 14 Apr 2009 05:27:13 +0000 (05:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69025 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index f981453bf081255c95a4f30e7fb4e219aaa1b717..2bcd65e7b6dfdf059531619115a00dcd8a4a08d7 100644 (file)
@@ -100,7 +100,7 @@ void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type,
 static void setGlobalVisibility(llvm::GlobalValue *GV,
                                 VisibilityAttr::VisibilityTypes Vis) {
   // Internal definitions should always have default visibility.
-  if (GV->hasInternalLinkage()) {
+  if (GV->hasLocalLinkage()) {
     GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
     return;
   }
@@ -122,7 +122,7 @@ static void setGlobalVisibility(llvm::GlobalValue *GV,
 static void setGlobalOptionVisibility(llvm::GlobalValue *GV,
                                       LangOptions::VisibilityMode Vis) {
   // Internal definitions should always have default visibility.
-  if (GV->hasInternalLinkage()) {
+  if (GV->hasLocalLinkage()) {
     GV->setVisibility(llvm::GlobalValue::DefaultVisibility);
     return;
   }