Use a trivial comdat for C++ tables.

This produces comdats for vtables, typeinfo, typeinfo names, and vtts.

When combined with llvm not producing implicit comdats, not doing this would
cause code bloat on ELF and link errors on COFF.

llvm-svn: 226227
This commit is contained in:
Rafael Espindola
2015-01-15 23:18:01 +00:00
parent 268757ba60
commit cb92c19fc4
4 changed files with 38 additions and 25 deletions

View File

@@ -1828,7 +1828,10 @@ CodeGenModule::CreateOrReplaceCXXRuntimeVariable(StringRef Name,
OldGV->eraseFromParent();
}
if (supportsCOMDAT() && GV->isWeakForLinker())
GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
return GV;
}