]> granicus.if.org Git - clang/commit
Revert r225705 from the branch.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Jan 2015 20:37:18 +0000 (20:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Jan 2015 20:37:18 +0000 (20:37 +0000)
commit71c1f3b6570c651f5fd16ee5711ae385bc7dd79e
tree971aae2899a1467b65f4b32622de1a9d5baee763
parentee2fee9f4322bc03c5cbe56dab0fbe90257d3cd8
Revert r225705 from the branch.

There were a few followup commits to this one, but only this one made it to
the branch.

Also, there are still some open issues (pr22285), so it is probably better
to leave this out of 3.6.

original message:

--------------------------------------------------------------------------
[patch][pr19848] Produce explicit comdats in clang.

The llvm IR until recently had no support for comdats. This was a problem when
targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of
dead bits to remain on the executable (unless -ffunction-sections,
-fdata-sections and --gc-sections were used).

To fix the problem, llvm's codegen will just assume that any weak or linkonce
that is not in an explicit comdat should be output in one with the same name as
the global.

This unfortunately breaks cases like pr19848 where a weak symbol is not
xpected to be part of any comdat.

Now that we have explicit comdats in the IR, we can finally get both cases
right.

This first patch just makes clang give explicit comdats to GlobalValues where
t is allowed to.

A followup patch to llvm will then stop implicitly producing comdats.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@226699 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGen/ms-declspecs.c
test/CodeGenCXX/cxx11-exception-spec.cpp
test/CodeGenCXX/dllexport-members.cpp
test/CodeGenCXX/dllexport.cpp
test/CodeGenCXX/dllimport.cpp
test/CodeGenCXX/ms-integer-static-data-members-exported.cpp
test/CodeGenCXX/ms-integer-static-data-members.cpp
test/CodeGenCXX/split-stacks.cpp
test/CodeGenCXX/static-init.cpp