[PATCH] D44482: Set dso_local for NSConcreteStackBlock
Rafael Avila de Espindola via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 14 10:48:05 PDT 2018
espindola created this revision.
espindola added reviewers: rnk, echristo.
https://reviews.llvm.org/D44482
Files:
lib/CodeGen/CGBlocks.cpp
test/CodeGen/blocks-windows.c
Index: test/CodeGen/blocks-windows.c
===================================================================
--- test/CodeGen/blocks-windows.c
+++ test/CodeGen/blocks-windows.c
@@ -67,7 +67,7 @@
return _Block_copy(^{ ++i; return i; });
}
-// CHECK-BLOCKS-IN-BLOCKS-DECL: @_NSConcreteStackBlock = external dllexport global i8*
+// CHECK-BLOCKS-IN-BLOCKS-DECL: @_NSConcreteStackBlock = external dso_local dllexport global i8*
// CHECK-BLOCKS-IN-BLOCKS-DEFN: @_NSConcreteStackBlock = common dso_local dllexport global [5 x i32]
// CHECK-BLOCKS-NOT-IN-BLOCKS: @_NSConcreteStackBlock = external dllimport global i8*
// CHECK-BLOCKS-NOT-IN-BLOCKS-EXTERN: @_NSConcreteStackBlock = external dllimport global i8*
Index: lib/CodeGen/CGBlocks.cpp
===================================================================
--- lib/CodeGen/CGBlocks.cpp
+++ lib/CodeGen/CGBlocks.cpp
@@ -2586,11 +2586,11 @@
}
}
- if (!CGM.getLangOpts().BlocksRuntimeOptional)
- return;
-
- if (GV->isDeclaration() && GV->hasExternalLinkage())
+ if (CGM.getLangOpts().BlocksRuntimeOptional && GV->isDeclaration() &&
+ GV->hasExternalLinkage())
GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage);
+
+ CGM.setDSOLocal(GV);
}
llvm::Constant *CodeGenModule::getBlockObjectDispose() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44482.138410.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180314/b2f3324c/attachment-0001.bin>
More information about the cfe-commits
mailing list