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/CodeGenModule.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/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 7a97aa64ea9..72d7a6cd8e0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1828,7 +1828,10 @@ CodeGenModule::CreateOrReplaceCXXRuntimeVariable(StringRef Name, OldGV->eraseFromParent(); } - + + if (supportsCOMDAT() && GV->isWeakForLinker()) + GV->setComdat(TheModule.getOrInsertComdat(GV->getName())); + return GV; } |