[PATCH] D71716: [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windows
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 23 02:14:33 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG86c9831bb40d: [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windows (authored by mstorsjo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71716/new/
https://reviews.llvm.org/D71716
Files:
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/test/CodeGenCXX/mingw-thread-local.cpp
Index: clang/test/CodeGenCXX/mingw-thread-local.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/mingw-thread-local.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-w64-mingw32 | FileCheck %s
+
+extern thread_local int var;
+
+int get() {
+ return var;
+}
+
+// CHECK: declare extern_weak void @_ZTH3var()
Index: clang/lib/CodeGen/ItaniumCXXABI.cpp
===================================================================
--- clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -2684,7 +2684,9 @@
if (Init) {
Init->setVisibility(Var->getVisibility());
- Init->setDSOLocal(Var->isDSOLocal());
+ // Don't mark an extern_weak function DSO local on windows.
+ if (!CGM.getTriple().isOSWindows() || !Init->hasExternalWeakLinkage())
+ Init->setDSOLocal(Var->isDSOLocal());
}
llvm::LLVMContext &Context = CGM.getModule().getContext();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71716.235116.patch
Type: text/x-patch
Size: 998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191223/5b627a70/attachment.bin>
More information about the cfe-commits
mailing list