aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-01-11 21:44:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-01-11 21:44:37 +0000
commitb1c65ff108de47a89585ad37874bd6cb232664cd (patch)
tree925fe394ffc971a2e1b108b7844b0a2c35b5f4ce /lib/CodeGen
parent9f959db60e8913abafe7d5f5f5a83dc6a5c8d87e (diff)
Set unnamed_addr for type infos that we are confortable marking as hidden. I
think it is safe to mark all type infos with unnamed_addr, but I am not sure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGRTTI.cpp6
-rw-r--r--lib/CodeGen/CodeGenModule.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp
index 444062bbff..839ff90940 100644
--- a/lib/CodeGen/CGRTTI.cpp
+++ b/lib/CodeGen/CGRTTI.cpp
@@ -640,8 +640,12 @@ llvm::Constant *RTTIBuilder::BuildTypeInfo(QualType Ty, bool Force) {
/*ForRTTI*/ true, /*ForDefinition*/ true);
else if (Hidden ||
(CGM.getCodeGenOpts().HiddenWeakVTables &&
- Linkage == llvm::GlobalValue::WeakODRLinkage))
+ Linkage == llvm::GlobalValue::WeakODRLinkage)) {
GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
+
+ // FIXME: Should we set this for all type infos?
+ GV->setUnnamedAddr(true);
+ }
return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy);
}
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 5d549c9196..9ed3150ff5 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -251,6 +251,7 @@ void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
// Otherwise, drop the visibility to hidden.
GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
+ GV->setUnnamedAddr(true);
}
llvm::StringRef CodeGenModule::getMangledName(GlobalDecl GD) {