Skip to content

Revert "Don't mangle inverse protocols within reabstraction thunks" #72145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/AST/ASTMangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,6 @@ std::string ASTMangler::mangleReabstractionThunkHelper(
assert(ThunkType->getPatternSubstitutions().empty() && "not implemented");
GenericSignature GenSig = ThunkType->getInvocationGenericSignature();

// Reabstraction thunks never reference inverse conformances.
llvm::SaveAndRestore X(AllowInverses, false);

beginMangling();
appendType(FromType, GenSig);
appendType(ToType, GenSig);
Expand Down
3 changes: 1 addition & 2 deletions lib/IRGen/IRGenMangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,8 @@ IRGenMangler::appendExtendedExistentialTypeShape(CanGenericSignature genSig,
CanType shapeType) {
// Append the generalization signature.
if (genSig) {
// Generalization signature never references inverses.
// Generalization signature never reference inverses.
llvm::SaveAndRestore X(AllowInverses, false);

appendGenericSignature(genSig);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s

// XFAIL: noncopyable_generics

protocol P {
associatedtype A

Expand Down
2 changes: 2 additions & 0 deletions test/SILGen/tuple_attribute_reabstraction.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %target-swift-emit-silgen %s | %FileCheck %s

// XFAIL: noncopyable_generics

public struct G<T> {
var t: T

Expand Down
2 changes: 2 additions & 0 deletions test/SILGen/variadic-generic-reabstract-tuple-result.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %target-swift-emit-silgen -disable-availability-checking %s | %FileCheck %s

// XFAIL: noncopyable_generics

// rdar://110391963

struct Use<each T> {}
Expand Down