Skip to content

Commit 7e182cf

Browse files
committed
[ASTMangler] Add a special entry point for mangling of distributed thunks
Distributed thunks loose all of the marker protocols associated with their generic parameters.
1 parent 8c21aaf commit 7e182cf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/swift/AST/ASTMangler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ class ASTMangler : public Mangler {
186186
Type GlobalActorBound,
187187
ModuleDecl *Module);
188188

189+
std::string mangleDistributedThunk(const FuncDecl *thunk);
190+
189191
/// Mangle a completion handler block implementation function, used for importing ObjC
190192
/// APIs as async.
191193
///

lib/AST/ASTMangler.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,3 +3457,11 @@ ASTMangler::mangleOpaqueTypeDescriptorRecord(const OpaqueTypeDecl *decl) {
34573457
appendOperator("Ho");
34583458
return finalize();
34593459
}
3460+
3461+
std::string ASTMangler::mangleDistributedThunk(const FuncDecl *thunk) {
3462+
// Marker protocols cannot be checked at runtime, so there is no point
3463+
// in recording them for distributed thunks.
3464+
llvm::SaveAndRestore<bool> savedAllowMarkerProtocols(AllowMarkerProtocols,
3465+
false);
3466+
return mangleEntity(thunk, SymbolKind::DistributedThunk);
3467+
}

0 commit comments

Comments
 (0)