freebsd-skq/contrib/llvm
Dimitry Andric 711f10ae9f Pull in r195318 from upstream llvm trunk:
The basic problem is that some mainstream programs cannot deal with the way
  clang optimizes tail calls, as in this example:

  int foo(void);
  int bar(void) {
  return foo();
  }

  where the call is transformed to:

   calll .L0$pb
  .L0$pb:
   popl  %eax
  .Ltmp0:
   addl  $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
   movl  foo@GOT(%eax), %eax
   popl  %ebp
   jmpl  *%eax                   # TAILCALL

  However, the GOT references must all be resolved at dlopen() time, and so this
  approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which
  usually populates the PLT with stubs that perform the actual resolving.

  This patch changes X86TargetLowering::LowerCall() to skip tail call
  optimization, if the called function is a global or external symbol.

This fixes problems with loading X.org driver modules, which could occur
when X.org was compiled on i386 with tailcall optimization on, for which
ports r312583 was committed as a workaround.  After this change, the
workaround can be removed.

MFC after:	3 days
2013-11-21 23:09:07 +00:00
..
include Merge upstream LLVM r192118: 2013-11-11 19:06:12 +00:00
lib Pull in r195318 from upstream llvm trunk: 2013-11-21 23:09:07 +00:00
tools Merge upstream LLDB r194487: 2013-11-13 17:06:26 +00:00
utils/TableGen Upgrade our copy of llvm/clang to 3.3 release. 2013-06-12 18:48:53 +00:00
LICENSE.TXT Upgrade our copy of llvm/clang to trunk r178860, in preparation of the 2013-04-12 17:57:40 +00:00