@@ -48,6 +48,7 @@ class SILLinker : public SILModuleTransform {
48
48
// (swift_retain, etc.). Link them in so they can be referenced in IRGen.
49
49
if (M.getOptions ().EmbeddedSwift && LinkEmbeddedRuntime) {
50
50
linkEmbeddedRuntimeFromStdlib ();
51
+ linkEmbeddedConcurrencyHookImpls ();
51
52
}
52
53
53
54
// In embedded Swift, we need to explicitly link any @_used globals and
@@ -80,6 +81,26 @@ class SILLinker : public SILModuleTransform {
80
81
linkEmbeddedRuntimeFunctionByName (" swift_retainCount" , { RefCounting });
81
82
}
82
83
84
+ void linkEmbeddedConcurrencyHookImpls () {
85
+ using namespace RuntimeConstants ;
86
+
87
+ // Note: we ignore errors here, because, depending on the exact situation
88
+ //
89
+ // (a) We might not have Concurrency anyway, and
90
+ //
91
+ // (b) The Impl function might be implemented in C++.
92
+ //
93
+ // Also, the hook Impl functions are marked as internal, unlike the
94
+ // runtime functions, which are public.
95
+
96
+ #define SWIFT_CONCURRENCY_HOOK (RETURNS, NAME, ...) \
97
+ linkUsedFunctionByName (#NAME " Impl" , SILLinkage::HiddenExternal)
98
+ #define SWIFT_CONCURRENCY_HOOK0 (RETURNS, NAME ) \
99
+ linkUsedFunctionByName (#NAME " Impl" , SILLinkage::HiddenExternal)
100
+
101
+ #include " swift/Runtime/ConcurrencyHooks.def"
102
+ }
103
+
83
104
void linkEmbeddedRuntimeFunctionByName (StringRef name,
84
105
ArrayRef<RuntimeEffect> effects) {
85
106
SILModule &M = *getModule ();
0 commit comments