diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-15 23:18:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-15 23:18:01 +0000 |
commit | cb92c19fc4ac08a6e8e4806ce6f217d2e4f83b5c (patch) | |
tree | e5c2efec0e84d0dbd7dd89db16f7acfb42d75861 /clang/lib/CodeGen/CGVTT.cpp | |
parent | 268757ba60a06aabd1d8b50d64db7d8b1c2dbbeb (diff) | |
download | bcm5719-llvm-cb92c19fc4ac08a6e8e4806ce6f217d2e4f83b5c.tar.gz bcm5719-llvm-cb92c19fc4ac08a6e8e4806ce6f217d2e4f83b5c.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CGVTT.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGVTT.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVTT.cpp b/clang/lib/CodeGen/CGVTT.cpp index bd280ea14e8..81bd65179b7 100644 --- a/clang/lib/CodeGen/CGVTT.cpp +++ b/clang/lib/CodeGen/CGVTT.cpp @@ -94,6 +94,9 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT, // Set the correct linkage. VTT->setLinkage(Linkage); + if (CGM.supportsCOMDAT() && VTT->isWeakForLinker()) + VTT->setComdat(CGM.getModule().getOrInsertComdat(VTT->getName())); + // Set the right visibility. CGM.setGlobalVisibility(VTT, RD); } |