Commit Graph

17 Commits

Author SHA1 Message Date
Rafael Espindola 27c60b512a Update for llvm API change.
Aliases in llvm now hold an arbitrary expression.

llvm-svn: 210063
2014-06-03 02:42:01 +00:00
Rafael Espindola b2633b9793 Update for llvm api change.
Now that llvm cannot represent alias cycles, we have to diagnose erros just
before trying to close the cycle. This degrades the errors a bit. The real
solution is what it was before: if we want to provide good errors for these
cases, we have to be able to find a clang level decl given a mangled name
and produce the error from Sema.

llvm-svn: 209008
2014-05-16 19:35:48 +00:00
Rafael Espindola 191b95125a Don't produce an alias between destructors with different calling conventions.
Fixes pr19007.

llvm-svn: 203007
2014-03-05 21:04:41 +00:00
Nico Rieck e6a1582595 Fix broken CHECK lines
llvm-svn: 201477
2014-02-16 07:29:41 +00:00
Alp Toker 544bd43624 Remove duplicated -cc1 in tests
llvm-svn: 196728
2013-12-08 18:06:52 +00:00
Joerg Sonnenberger 374c2bb37e Adjust r194296 to not apply the alias replacement for externally
available always-inline functions. This breaks libc++'s locale
implementation. Code generation for this case should be fixed, but this
is a stop gap fix for clang 3.4.

llvm-svn: 195501
2013-11-22 21:34:35 +00:00
Rafael Espindola d967badc64 Don't use alias from derived dtor to base dtor at -O0.
This patch disables aliasing (and rauw) of derived dtors to base dtors at -O0.
This optimization can have a negative impact on the debug quality.

This was a latent bug for some time with local classes, but got noticed when it
was generalized and broke gdb's destrprint.exp.

llvm-svn: 194618
2013-11-13 23:20:45 +00:00
Rafael Espindola 129d313c8d Avoid producing mismatched comdats.
The problem was that given

template<typename T>
struct foo {
  ~foo() {}
};
template class foo<int>;

We would produce a alias, creating a comdat with D0 and D1, since the symbols
have to be weak. Another TU is not required to have a explicit template
instantiation definition or an explict template instantiation declaration and
for

template<typename T>
struct foo {
  ~foo() {}
};
foo<int> a;

we would produce a comdat with only one symbol in it.

llvm-svn: 194520
2013-11-12 22:06:46 +00:00
Rafael Espindola 50e1f0095f Add a testcase where we replace a destructor with an alias.
This is a reduced testcase from a cast to Function failing during bootstrap.

llvm-svn: 194430
2013-11-11 22:55:13 +00:00
Rafael Espindola b15683e635 Fix pr17875.
The assert this patch deletes was valid only when aliasing D2 to D1, not when
looking at a base class. Since the assert was in the path where we had already
decided to not produce an alias, just drop it.

llvm-svn: 194411
2013-11-11 19:35:06 +00:00
Rafael Espindola 961ba21a47 Don't emit an internal destructor that is identical to an external one.
It is not safe to emit alias to undefined (not supported by ELF or COFF), but
it is safe to rauw when the alias would have been internal or linkonce_odr.

llvm-svn: 194307
2013-11-09 01:57:21 +00:00
Rafael Espindola 23d3751170 Use rauw for all discardable aliases, not just linkonce_odr.
llvm-svn: 194296
2013-11-08 23:46:20 +00:00
Rafael Espindola e2ec6faa36 If a linkonce_odr dtor/ctor is identical to another one, just rauw.
Unlike an alias a rauw is always safe, so we don't need to avoid this
optimization when the replacement is not know to be available in every TU.

llvm-svn: 194288
2013-11-08 22:59:46 +00:00
Rafael Espindola 2e2995bf50 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194095
2013-11-05 21:37:29 +00:00
Rafael Espindola b5ac86865a Revert "Produce direct calls instead of alias to linkonce_odr functions."
This reverts commit r194046.
Debugging a bootstrap issue.

llvm-svn: 194047
2013-11-05 05:29:54 +00:00
Rafael Espindola 5d79a51a45 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194046
2013-11-05 05:22:36 +00:00
Rafael Espindola 3f643bd124 Use aliases for more constructors and destructors.
With this patch we produce alias for cases like

template<typename T>
struct foobar {
  foobar() {
  }
};
template struct foobar<void>;

We just have to be careful to produce the same aliases in every TU because
of comdats.

llvm-svn: 194000
2013-11-04 18:38:59 +00:00