diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-06-11 04:08:55 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-11 04:08:55 +0000 |
commit | 35ab328e942259b6ebb75785f54abbfdf6f50d93 (patch) | |
tree | cc50a07928a9a2b04cbbff3a9aae354bfc8eca6e /clang/lib/AST/ASTContext.cpp | |
parent | a813d608a943579804eb9f12c8ede2955bb3a777 (diff) | |
download | bcm5719-llvm-35ab328e942259b6ebb75785f54abbfdf6f50d93.tar.gz bcm5719-llvm-35ab328e942259b6ebb75785f54abbfdf6f50d93.zip |
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
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index eaf77e96254..ddde907522b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -7843,14 +7843,6 @@ static GVALinkage basicGVALinkageForVariable(const ASTContext &Context, : StaticLocalLinkage; } - // On Darwin, the backing variable for a C++11 thread_local variable always - // has internal linkage; all accesses should just be calls to the - // Itanium-specified entry point, which has the normal linkage of the - // variable. - if (VD->getTLSKind() == VarDecl::TLS_Dynamic && - Context.getTargetInfo().getTriple().isMacOSX()) - return GVA_Internal; - switch (VD->getTemplateSpecializationKind()) { case TSK_Undeclared: case TSK_ExplicitSpecialization: |