ASTMangler: Fix conformance path mangling for noncopyable generics

This commit is contained in:
Slava Pestov
2024-03-01 15:43:47 -05:00
parent d88faf3626
commit e85f8e1e56
2 changed files with 8 additions and 3 deletions

View File

@@ -3697,6 +3697,12 @@ static unsigned conformanceRequirementIndex(
if (req.getKind() != RequirementKind::Conformance)
continue;
// This is an ABI compatibility hack for noncopyable generics.
// We should have really been skipping marker protocols here all along,
// but it's too late now, so skip Copyable and Escapable specifically.
if (req.getProtocolDecl()->getInvertibleProtocolKind())
continue;
if (req.getFirstType()->isEqual(entry.first) &&
req.getProtocolDecl() == entry.second)
return result;
@@ -3704,7 +3710,8 @@ static unsigned conformanceRequirementIndex(
++result;
}
llvm_unreachable("Conformance access path step is missing from requirements");
llvm::errs() <<"Conformance access path step is missing from requirements";
abort();
}
void ASTMangler::appendDependentProtocolConformance(