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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-04-14 05:27:13 +00:00
Родитель 959875a66d
Коммит df102fcb97
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

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