CodeGen: Correct linkage of thread_local for OS X
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 11 Jun 2014 04:08:55 +0000 (04:08 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 11 Jun 2014 04:08:55 +0000 (04:08 +0000)
commit35ab328e942259b6ebb75785f54abbfdf6f50d93
treecc50a07928a9a2b04cbbff3a9aae354bfc8eca6e
parenta813d608a943579804eb9f12c8ede2955bb3a777
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.

llvm-svn: 210632
clang/lib/AST/ASTContext.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/test/CodeGenCXX/tls-init-funcs.cpp