From 1847baa20e02284d85007f3eea9a7d4c040650aa Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 22 Apr 2013 08:06:17 +0000 Subject: Don't emit _ZTW wrappers for TLS variables which don't use the C++ thread_local keyword. llvm-svn: 180004 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fdd35684722..5a10602589f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1479,7 +1479,8 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, } if (D->getTLSKind()) { - CXXThreadLocals.push_back(std::make_pair(D, GV)); + if (D->getTLSKind() == VarDecl::TLS_Dynamic) + CXXThreadLocals.push_back(std::make_pair(D, GV)); setTLSMode(GV, *D); } } -- cgit v1.2.3