do not set visibility on "private" or "available externally" linkage objects.

llvm-svn: 69025
This commit is contained in:
Chris Lattner
2009-04-14 05:27:13 +00:00
parent 825676afdf
commit 6a0f907a5e

View 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;
}