Author: rafael Date: Wed Mar 7 15:18:06 2018 New Revision: 326961 URL: http://llvm.org/viewvc/llvm-project?rev=326961&view=rev Log: Set dso_local on tls init functions.
We copy the visibility, so copying the dso_local flag seems the natural thing to do. Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=326961&r1=326960&r2=326961&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original) +++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Wed Mar 7 15:18:06 2018 @@ -2398,8 +2398,10 @@ void ItaniumCXXABI::EmitThreadLocalInitF CGM.SetLLVMFunctionAttributes(nullptr, FI, cast<llvm::Function>(Init)); } - if (Init) + if (Init) { Init->setVisibility(Var->getVisibility()); + Init->setDSOLocal(Var->isDSOLocal()); + } llvm::LLVMContext &Context = CGM.getModule().getContext(); llvm::BasicBlock *Entry = llvm::BasicBlock::Create(Context, "", Wrapper); Modified: cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp?rev=326961&r1=326960&r2=326961&view=diff ============================================================================== --- cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp (original) +++ cfe/trunk/test/CodeGenCXX/runtime-dllstorage.cpp Wed Mar 7 15:18:06 2018 @@ -114,6 +114,7 @@ void l() { // CHECK-MS-DAG: declare void @_Init_thread_header(i32*) // CHECK-MS-DAG: declare void @_Init_thread_footer(i32*) +// CHECK-IA-DAG: @_ZTH1t = dso_local alias void (), void ()* @__tls_init // CHECK-IA-DAG: declare i32 @__gxx_personality_v0(...) // CHECK-IA-DAG: define linkonce_odr hidden void @__clang_call_terminate(i8*) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits