diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-09-18 23:41:44 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-09-18 23:41:44 +0000 |
commit | c0ce9eca0b709b16e9c1d0f1686d4e2314af02b8 (patch) | |
tree | 71ed27a2daa450a3c47f64aac713d573e5751d7c /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 2ea8639696ce7f3f732cc2f3607a1aa794eca86f (diff) | |
download | llvm-c0ce9eca0b709b16e9c1d0f1686d4e2314af02b8.zip llvm-c0ce9eca0b709b16e9c1d0f1686d4e2314af02b8.tar.gz llvm-c0ce9eca0b709b16e9c1d0f1686d4e2314af02b8.tar.bz2 |
Put more stuff in the comdat used for variables with static init.
Clang can already handle
-------------------------------------------
struct S {
static const int x;
};
template<typename T> struct U {
static const int k;
};
template<typename T> const int U<T>::k = T::x;
const int S::x = 42;
extern const int *f();
const int *g() { return &U<S>::k; }
int main() {
return *f() + U<S>::k;
}
const int *f() { return &U<S>::k; }
-------------------------------------------
since r217264 which puts the .inint_array section in the same COMDAT
as the variable.
This patch allows the linker to more easily delete some dead code and data by
putting the guard variable and init function in the same COMDAT.
llvm-svn: 218089
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
0 files changed, 0 insertions, 0 deletions