Commit Graph

8 Commits

Author SHA1 Message Date
Manman Ren 8592a9a7be [TLS on Darwin] use CXX_FAST_TLS calling convention for access functions.
Also set nounwind attribute.

rdar://problem/9001553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255860 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-17 00:42:36 +00:00
Manman Ren ff855dea21 [TLS on Darwin] change how we handle globals with linkonce or weak linkage.
This is about how we handle static member of a template. Before this commit,
we use internal linkage for the IR thread-local variable, which is inefficient.
With this commit, we will start to follow Itanium C++ ABI.

rdar://problem/23415206

Reviewed by John McCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252814 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-11 22:42:31 +00:00
David Majnemer 4ad1987457 CodeGen: Don't emit a thread-wrapper if we can't touch the backing variable
OS X TLS has all accesses going through the thread-wrapper function and
gives the backing thread-local variable internal linkage.  This means
that thread-wrappers must have WeakAnyLinkage so that references to the
internal thread-local variables do not get propagated to other code.

It also means that translation units which do not provide a definition
for the thread-local variable cannot attempt to emit a thread-wrapper
because the thread wrapper will attempt to reference the backing
variable.

Differential Revision: http://reviews.llvm.org/D4109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212841 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-11 20:28:10 +00:00
David Majnemer f64ce12328 CodeGen: Correct linkage of thread_local for OS X
The backing store of thread local variables is internal for OS X and all
accesses must go through the thread wrapper.

However, individual TUs may have inlined through the thread wrapper.
To fix this, give the thread wrapper functions WeakAnyLinkage.  This
prevents them from getting inlined into call-sites.

This fixes PR19989.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210632 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11 04:08:55 +00:00
Bill Wendling 4e3b54b4ac Use the Itanium ABI for thread_local on Darwin.
After some discussion, it was decided to use the Itanium ABI for thread_local on
Darwin OS X platforms. This involved a couple of changes. First, we use
"_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables
are marked with 'internal' linkage, because we want all access to be calls to
the Itanium-specific entry point, which has normal linkage.
<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 19:18:03 +00:00
Richard Smith 8f4bdc0e37 Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin systems and did not do the right thing on Darwin.
Original commit message:

Emit the TLS intialization functions into a list.

Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30 21:34:13 +00:00
Bill Wendling aa3cef4113 Modify triple to try to make it pass on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180748 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 23:14:24 +00:00
Bill Wendling 7c6b7ba5f5 Emit the TLS intialization functions into a list.
Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 22:27:16 +00:00