CodeGen: Weak reference temporaries belong in a COMDAT

llvm-svn: 229902
This commit is contained in:
David Majnemer
2015-02-19 19:35:18 +00:00
parent db9050fd49
commit f63bcaa2c5
2 changed files with 6 additions and 4 deletions

View File

@@ -3104,6 +3104,8 @@ llvm::Constant *CodeGenModule::GetAddrOfGlobalTemporary(
setGlobalVisibility(GV, VD);
GV->setAlignment(
getContext().getTypeAlignInChars(MaterializedType).getQuantity());
if (supportsCOMDAT() && GV->isWeakForLinker())
GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
if (VD->getTLSKind())
setTLSMode(GV, *VD);
Slot = GV;