Skip to content

Commit e85f8e1

Browse files
committed
ASTMangler: Fix conformance path mangling for noncopyable generics
1 parent d88faf3 commit e85f8e1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3697,14 +3697,21 @@ static unsigned conformanceRequirementIndex(
36973697
if (req.getKind() != RequirementKind::Conformance)
36983698
continue;
36993699

3700+
// This is an ABI compatibility hack for noncopyable generics.
3701+
// We should have really been skipping marker protocols here all along,
3702+
// but it's too late now, so skip Copyable and Escapable specifically.
3703+
if (req.getProtocolDecl()->getInvertibleProtocolKind())
3704+
continue;
3705+
37003706
if (req.getFirstType()->isEqual(entry.first) &&
37013707
req.getProtocolDecl() == entry.second)
37023708
return result;
37033709

37043710
++result;
37053711
}
37063712

3707-
llvm_unreachable("Conformance access path step is missing from requirements");
3713+
llvm::errs() <<"Conformance access path step is missing from requirements";
3714+
abort();
37083715
}
37093716

37103717
void ASTMangler::appendDependentProtocolConformance(

test/SILGen/mangle_conformance_access_path.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// RUN: %target-swift-frontend -emit-module %S/Inputs/mangle_conformance_access_path_helper.swift -emit-module-path %t/mangle_conformance_access_path_helper.swiftmodule
33
// RUN: %target-swift-frontend -emit-silgen %s -I %t | %FileCheck %s
44

5-
// XFAIL: noncopyable_generics
6-
75
import mangle_conformance_access_path_helper
86

97
struct GG<T : P> {}

0 commit comments

Comments
 (0)