Skip to content

Commit 89be5fb

Browse files
authored
[AutoDiff] Fix subset parameters thunk linkage. (#24901)
Use shared linkage to prevent `duplicate symbol` error for thunks.
1 parent 2efb6e1 commit 89be5fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5721,9 +5721,9 @@ ADContext::getOrCreateSubsetParametersThunkForAssociatedFunction(
57215721

57225722
auto loc = origFnOperand.getLoc();
57235723
SILOptFunctionBuilder fb(getTransform());
5724-
auto *thunk = fb.getOrCreateFunction(
5725-
loc, thunkName, SILLinkage::Hidden, thunkType, IsBare, IsTransparent,
5726-
caller->isSerialized(), IsNotDynamic, ProfileCounter(), IsThunk);
5724+
auto *thunk = fb.getOrCreateSharedFunction(
5725+
loc, thunkName, thunkType, IsBare, IsTransparent, caller->isSerialized(),
5726+
ProfileCounter(), IsThunk, IsNotDynamic);
57275727

57285728
if (!thunk->empty())
57295729
return {thunk, interfaceSubs};

0 commit comments

Comments
 (0)