Skip to content

Commit c9a0295

Browse files
committed
[Distributed] Synthesis: Start using special mangling for distributed thunks
1 parent 7e182cf commit c9a0295

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/SIL/IR/SILDeclRef.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,10 @@ std::string SILDeclRef::mangle(ManglingKind MKind) const {
914914
return CDeclA->Name.str();
915915
}
916916

917+
if (SKind == ASTMangler::SymbolKind::DistributedThunk) {
918+
return mangler.mangleDistributedThunk(cast<FuncDecl>(getDecl()));
919+
}
920+
917921
// Otherwise, fall through into the 'other decl' case.
918922
LLVM_FALLTHROUGH;
919923

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,10 @@ deriveBodyDistributed_thunk(AbstractFunctionDecl *thunk, void *context) {
375375
{
376376
// --- Mangle the thunk name
377377
Mangle::ASTMangler mangler;
378-
auto symbolKind = swift::Mangle::ASTMangler::SymbolKind::DistributedThunk;
379-
auto mangled = C.AllocateCopy(mangler.mangleEntity(thunk, symbolKind));
380-
StringRef mangledTargetStringRef = StringRef(mangled);
381-
auto mangledTargetStringLiteral = new (C)
382-
StringLiteralExpr(mangledTargetStringRef, SourceRange(), implicit);
378+
auto mangled =
379+
C.AllocateCopy(mangler.mangleDistributedThunk(cast<FuncDecl>(thunk)));
380+
auto mangledTargetStringLiteral =
381+
new (C) StringLiteralExpr(mangled, SourceRange(), implicit);
383382

384383
// --- let target = RemoteCallTarget(<mangled name>)
385384
targetVar->setInterfaceType(remoteCallTargetTy);

0 commit comments

Comments
 (0)