aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRtti.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-11-18 03:21:29 +0000
committerMike Stump <mrs@apple.com>2009-11-18 03:21:29 +0000
commit88a4a62b8a18dc24006ef9d44e28de6c7dc987ba (patch)
treea3fe786448a9dfad390f64298691b71f3e426a4b /lib/CodeGen/CGRtti.cpp
parent066b983348e06a5f9dbbb72041077bbf1a0fb9c1 (diff)
Be sure to set visibility for ZTI symbols for classes from the class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRtti.cpp')
-rw-r--r--lib/CodeGen/CGRtti.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/CGRtti.cpp b/lib/CodeGen/CGRtti.cpp
index 4a9779a9b2..01767466e8 100644
--- a/lib/CodeGen/CGRtti.cpp
+++ b/lib/CodeGen/CGRtti.cpp
@@ -145,7 +145,7 @@ public:
llvm::Constant *finish(std::vector<llvm::Constant *> &info,
llvm::GlobalVariable *GV,
- llvm::StringRef Name) {
+ llvm::StringRef Name, bool Extern) {
llvm::GlobalVariable::LinkageTypes linktype;
linktype = llvm::GlobalValue::LinkOnceODRLinkage;
@@ -165,7 +165,8 @@ public:
OGV->replaceAllUsesWith(NewPtr);
OGV->eraseFromParent();
}
- GV->setVisibility(llvm::GlobalVariable::HiddenVisibility);
+ if (!Extern)
+ GV->setVisibility(llvm::GlobalVariable::HiddenVisibility);
return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy);
}
@@ -230,7 +231,9 @@ public:
}
}
- return finish(info, GV, Out.str());
+ bool Extern = CGM.getDeclVisibilityMode(RD) != LangOptions::Hidden;
+
+ return finish(info, GV, Out.str(), Extern);
}
/// - BuildFlags - Build a __flags value for __pbase_type_info.
@@ -291,7 +294,7 @@ public:
if (PtrMem)
info.push_back(BuildType2(BTy));
- return finish(info, GV, Out.str());
+ return finish(info, GV, Out.str(), false);
}
llvm::Constant *BuildSimpleType(QualType Ty, const char *vtbl) {
@@ -312,7 +315,7 @@ public:
info.push_back(C);
info.push_back(BuildName(Ty));
- return finish(info, GV, Out.str());
+ return finish(info, GV, Out.str(), false);
}
llvm::Constant *BuildType(QualType Ty) {