Go to file
Evgeniy Stepanov 93db40a147 Always_inline codegen rewrite.
Current implementation may end up emitting an undefined reference for
an "inline __attribute__((always_inline))" function by generating an
"available_externally alwaysinline" IR function for it and then failing to
inline all the calls. This happens when a call to such function is in dead
code. As the inliner is an SCC pass, it does not process dead code.

Libc++ relies on the compiler never emitting such undefined reference.

With this patch, we emit a pair of
1. internal alwaysinline definition (called F.alwaysinline)
2a. A stub F() { musttail call F.alwaysinline }
  -- or, depending on the linkage --
2b. A declaration of F.

The frontend ensures that F.inlinefunction is only used for direct
calls, and the stub is used for everything else (taking the address of
the function, really). Declaration (2b) is emitted in the case when
"inline" is meant for inlining only (like __gnu_inline__ and some
other cases).

This approach, among other nice properties, ensures that alwaysinline
functions are always internal, making it impossible for a direct call
to such function to produce an undefined symbol reference.

This patch is based on ideas by Chandler Carruth and Richard Smith.

llvm-svn: 247494
2015-09-12 01:07:37 +00:00
clang Always_inline codegen rewrite. 2015-09-12 01:07:37 +00:00
clang-tools-extra [clang-tidy] misc-sizeof-container: whitelist std::bitset<>. 2015-09-11 22:54:44 +00:00
compiler-rt ubsan: Disable vptr validation on powerpc64. 2015-09-12 00:08:28 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Update mailing list reference. 2015-08-24 22:43:24 +00:00
libcxx Implementation of Boyer-Moore and Boyer-Moore-Horspool searchers for the LFTS. 2015-09-08 17:59:09 +00:00
libcxxabi Convert LIBCXXABI_BUILD_32_BITS to LLVM_BUILD_32_BITS. 2015-09-01 01:02:06 +00:00
libunwind unwind: cleanup -Wunused-parameter 2015-09-01 04:29:03 +00:00
lld Start adding support for creating shared libraries. 2015-09-11 22:42:45 +00:00
lldb Fix a thinko causing test logs for crashes to not get written. 2015-09-11 21:27:37 +00:00
llgo [llgo] drop debug/DIBuilder.Declare 2015-09-01 11:52:37 +00:00
llvm Move asserts from PHINode::addIncoming to PHINode::setIncoming* 2015-09-12 00:08:21 +00:00
openmp [OMPT] Fix assertion that arises when waiting for proxy tasks on runtime shutdown 2015-09-10 21:33:50 +00:00
polly Merge TempScop into Scop 2015-09-11 21:41:48 +00:00