Skip to content

Commit 3243def

Browse files
committed
Revert "[IRGen] Mangling for async, non-constant partial_apply thunks."
This reverts commit efaaee3.
1 parent d765434 commit 3243def

File tree

9 files changed

+1
-47
lines changed

9 files changed

+1
-47
lines changed

docs/ABI/Mangling.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ Globals
147147
// TODO check this::
148148
global ::= mangled-name 'TA' // partial application forwarder
149149
global ::= mangled-name 'Ta' // ObjC partial application forwarder
150-
global ::= mangled-name 'Tw' index // async partial apply thunk for a non-constant function
151150
global ::= mangled-name 'TQ' index // Async await continuation partial function
152151
global ::= mangled-name 'TY' index // Async suspend continuation partial function
153152

include/swift/Demangling/DemangleNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ NODE(AutoDiffSubsetParametersThunk)
313313
NODE(AutoDiffDerivativeVTableThunk)
314314
NODE(DifferentiabilityWitness)
315315
NODE(IndexSubset)
316-
NODE(AsyncNonconstantPartialApplyThunk)
317316
NODE(AsyncAwaitResumePartialFunction)
318317
NODE(AsyncSuspendResumePartialFunction)
319318

lib/Demangling/Demangler.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ bool swift::Demangle::isFunctionAttr(Node::Kind kind) {
123123
case Node::Kind::DynamicallyReplaceableFunctionKey:
124124
case Node::Kind::DynamicallyReplaceableFunctionVar:
125125
case Node::Kind::AsyncFunctionPointer:
126-
case Node::Kind::AsyncNonconstantPartialApplyThunk:
127126
case Node::Kind::AsyncAwaitResumePartialFunction:
128127
case Node::Kind::AsyncSuspendResumePartialFunction:
129128
return true;
@@ -2536,11 +2535,6 @@ NodePointer Demangler::demangleThunkOrSpecialization() {
25362535
return demangleAutoDiffFunctionOrSimpleThunk(
25372536
Node::Kind::AutoDiffFunction);
25382537
}
2539-
case 'w': {
2540-
NodePointer discriminator = demangleIndexAsNode();
2541-
return createWithChild(Node::Kind::AsyncNonconstantPartialApplyThunk,
2542-
discriminator);
2543-
}
25442538
default:
25452539
return nullptr;
25462540
}

lib/Demangling/NodePrinter.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ class NodePrinter {
570570
case Node::Kind::AutoDiffFunctionKind:
571571
case Node::Kind::DifferentiabilityWitness:
572572
case Node::Kind::IndexSubset:
573-
case Node::Kind::AsyncNonconstantPartialApplyThunk:
574573
case Node::Kind::AsyncAwaitResumePartialFunction:
575574
case Node::Kind::AsyncSuspendResumePartialFunction:
576575
return false;
@@ -2807,12 +2806,6 @@ NodePointer NodePrinter::print(NodePointer Node, bool asPrefixContext) {
28072806
case Node::Kind::AsyncFunctionPointer:
28082807
Printer << "async function pointer to ";
28092808
return nullptr;
2810-
case Node::Kind::AsyncNonconstantPartialApplyThunk:
2811-
Printer << "(";
2812-
print(Node->getChild(0));
2813-
Printer << ")";
2814-
Printer << " thunk for non-constant partial apply in ";
2815-
return nullptr;
28162809
case Node::Kind::AsyncAwaitResumePartialFunction:
28172810
Printer << "(";
28182811
print(Node->getChild(0));

lib/Demangling/OldRemangler.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,10 +606,6 @@ void Remangler::mangleDynamicallyReplaceableFunctionVar(Node *node) {
606606
Buffer << "TX";
607607
}
608608

609-
void Remangler::mangleAsyncNonconstantPartialApplyThunk(Node *node) {
610-
unreachable("unsupported");
611-
}
612-
613609
void Remangler::mangleAsyncAwaitResumePartialFunction(Node *node) {
614610
unreachable("unsupported");
615611
}

lib/Demangling/Remangler.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,6 @@ void Remangler::mangleGlobal(Node *node) {
13761376
case Node::Kind::DynamicallyReplaceableFunctionImpl:
13771377
case Node::Kind::DynamicallyReplaceableFunctionVar:
13781378
case Node::Kind::AsyncFunctionPointer:
1379-
case Node::Kind::AsyncNonconstantPartialApplyThunk:
13801379
case Node::Kind::AsyncAwaitResumePartialFunction:
13811380
case Node::Kind::AsyncSuspendResumePartialFunction:
13821381
mangleInReverseOrder = true;
@@ -1887,11 +1886,6 @@ void Remangler::mangleDynamicallyReplaceableFunctionVar(Node *node) {
18871886
Buffer << "TX";
18881887
}
18891888

1890-
void Remangler::mangleAsyncNonconstantPartialApplyThunk(Node *node) {
1891-
Buffer << "Tw";
1892-
mangleChildNode(node, 0);
1893-
}
1894-
18951889
void Remangler::mangleAsyncAwaitResumePartialFunction(Node *node) {
18961890
Buffer << "TQ";
18971891
mangleChildNode(node, 0);

lib/IRGen/IRGenMangler.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,6 @@ std::string IRGenMangler::manglePartialApplyForwarder(StringRef FuncName) {
7979
return finalize();
8080
}
8181

82-
std::string
83-
IRGenMangler::mangleAsyncNonconstantPartialApplyThunk(StringRef FuncName,
84-
unsigned index) {
85-
if (FuncName.empty()) {
86-
beginMangling();
87-
} else {
88-
if (FuncName.startswith(MANGLING_PREFIX_STR)) {
89-
Buffer << FuncName;
90-
} else {
91-
beginMangling();
92-
appendIdentifier(FuncName);
93-
}
94-
}
95-
appendOperator("Tw", Index(index));
96-
return finalize();
97-
}
98-
9982
SymbolicMangling
10083
IRGenMangler::withSymbolicReferences(IRGenModule &IGM,
10184
llvm::function_ref<void ()> body) {

lib/IRGen/IRGenMangler.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,7 @@ class IRGenMangler : public Mangle::ASTMangler {
574574
}
575575

576576
std::string manglePartialApplyForwarder(StringRef FuncName);
577-
std::string mangleAsyncNonconstantPartialApplyThunk(StringRef FuncName,
578-
unsigned index);
579-
577+
580578
std::string mangleTypeForForeignMetadataUniquing(Type type) {
581579
return mangleTypeWithoutPrefix(type);
582580
}

test/Demangle/Inputs/manglings.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,6 @@ $sS2f8mangling3FooV13TangentVectorVIegydd_SfAESfIegydd_TJOp ---> autodiff self-r
393393
$s13test_mangling3fooyS2f_S2ftFWJrSpSr ---> reverse-mode differentiability witness for test_mangling.foo(Swift.Float, Swift.Float, Swift.Float) -> Swift.Float with respect to parameters {0} and results {0}
394394
$s13test_mangling3fooyS2f_xq_t16_Differentiation14DifferentiableR_r0_lFAcDRzAcDR_r0_lWJrUSSpSr ---> reverse-mode differentiability witness for test_mangling.foo<A, B where B: _Differentiation.Differentiable>(Swift.Float, A, B) -> Swift.Float with respect to parameters {1, 2} and results {0} with <A, B where A: _Differentiation.Differentiable, B: _Differentiation.Differentiable>
395395
$s5async1hyyS2iJXEF ---> async.h(@Sendable (Swift.Int) -> Swift.Int) -> ()
396-
$s12create_pa_f2Tw_ ---> (0) thunk for non-constant partial apply in create_pa_f2
397-
$s12create_pa_f2Tw0_ ---> (1) thunk for non-constant partial apply in create_pa_f2
398396
$s5Actor02MyA0C17testAsyncFunctionyyYKFTY0_ ---> (1) suspend resume partial function for Actor.MyActor.testAsyncFunction() async throws -> ()
399397
$s5Actor02MyA0C17testAsyncFunctionyyYKFTQ1_ ---> (2) await resume partial function for Actor.MyActor.testAsyncFunction() async throws -> ()
400398
$s4diff1hyyS2ijfXEF ---> diff.h(@differentiable(_forward) (Swift.Int) -> Swift.Int) -> ()

0 commit comments

Comments
 (0)