r327544 - Set dso_local for NSConcreteStackBlock.
Rafael Espindola via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 14 11:19:26 PDT 2018
Author: rafael
Date: Wed Mar 14 11:19:26 2018
New Revision: 327544
URL: http://llvm.org/viewvc/llvm-project?rev=327544&view=rev
Log:
Set dso_local for NSConcreteStackBlock.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/test/CodeGen/blocks-windows.c
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=327544&r1=327543&r2=327544&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Wed Mar 14 11:19:26 2018
@@ -2586,11 +2586,11 @@ static void configureBlocksRuntimeObject
}
}
- 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() {
Modified: cfe/trunk/test/CodeGen/blocks-windows.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/blocks-windows.c?rev=327544&r1=327543&r2=327544&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/blocks-windows.c (original)
+++ cfe/trunk/test/CodeGen/blocks-windows.c Wed Mar 14 11:19:26 2018
@@ -67,7 +67,7 @@ int (*g(void))(void) {
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*
More information about the cfe-commits
mailing list