summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRTTI.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-02-08 00:41:16 +0000
committerJohn McCall <rjmccall@apple.com>2014-02-08 00:41:16 +0000
commitec0ca13fc0cbec5984df5836f2c7384daec0bbea (patch)
tree61102fcda024a232a3eff461cc6558086457772b /lib/CodeGen/CGRTTI.cpp
parentb7f8c7a32c4b630a4f7fe73a5418b30831651323 (diff)
downloadclang-ec0ca13fc0cbec5984df5836f2c7384daec0bbea.tar.gz
clang-ec0ca13fc0cbec5984df5836f2c7384daec0bbea.tar.bz2
clang-ec0ca13fc0cbec5984df5836f2c7384daec0bbea.tar.xz
Remove the -fhidden-weak-vtables -cc1 option. It was dead,
gross, and increasingly replaced through other mechanisms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGRTTI.cpp')
-rw-r--r--lib/CodeGen/CGRTTI.cpp38
1 files changed, 14 insertions, 24 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp
index aa687b9560..351b9fc4e2 100644
--- a/lib/CodeGen/CGRTTI.cpp
+++ b/lib/CodeGen/CGRTTI.cpp
@@ -644,30 +644,20 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty, bool Force) {
OldGV->eraseFromParent();
}
- // GCC only relies on the uniqueness of the type names, not the
- // type_infos themselves, so we can emit these as hidden symbols.
- // But don't do this if we're worried about strict visibility
- // compatibility.
- if (const RecordType *RT = dyn_cast<RecordType>(Ty)) {
- const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
-
- CGM.setTypeVisibility(GV, RD, CodeGenModule::TVK_ForRTTI);
- CGM.setTypeVisibility(TypeName, RD, CodeGenModule::TVK_ForRTTIName);
- } else {
- Visibility TypeInfoVisibility = DefaultVisibility;
- if (CGM.getCodeGenOpts().HiddenWeakVTables &&
- Linkage == llvm::GlobalValue::LinkOnceODRLinkage)
- TypeInfoVisibility = HiddenVisibility;
-
- // The type name should have the same visibility as the type itself.
- Visibility ExplicitVisibility = Ty->getVisibility();
- TypeName->setVisibility(CodeGenModule::
- GetLLVMVisibility(ExplicitVisibility));
-
- TypeInfoVisibility = minVisibility(TypeInfoVisibility, Ty->getVisibility());
- GV->setVisibility(CodeGenModule::GetLLVMVisibility(TypeInfoVisibility));
- }
-
+ // Give the type_info object and name the formal visibility of the
+ // type itself.
+ Visibility formalVisibility = Ty->getVisibility();
+ llvm::GlobalValue::VisibilityTypes llvmVisibility =
+ CodeGenModule::GetLLVMVisibility(formalVisibility);
+ TypeName->setVisibility(llvmVisibility);
+ GV->setVisibility(llvmVisibility);
+
+ // Contra the Itanium ABI, we do not rely or guarantee strict
+ // address-equivalence of type_info objects.
+ //
+ // The main effect of setting this flag is that LLVM will
+ // automatically decrease the visibility of linkonce_odr type_info
+ // objects.
GV->setUnnamedAddr(true);
return llvm::ConstantExpr::getBitCast(GV, CGM.Int8PtrTy);