mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ABIChecker: diagnose mangled name changes
Moving generic constraint from extension to its member or vice versa may change the mangled name of the member without changing the generic signature, thus introducing ABI breakages. This change teaches the ABI checker to diagnose USR (mangled name) changes to cover such cases. rdar://78276290
This commit is contained in:
@@ -944,6 +944,8 @@ static bool isSDKNodeEqual(SDKContext &Ctx, const SDKNode &L, const SDKNode &R)
|
||||
if (Left->getFixedBinaryOrder() != Right->getFixedBinaryOrder())
|
||||
return false;
|
||||
}
|
||||
if (Left->getUsr() != Right->getUsr())
|
||||
return false;
|
||||
LLVM_FALLTHROUGH;
|
||||
}
|
||||
case SDKNodeKind::Conformance:
|
||||
@@ -2551,6 +2553,13 @@ void swift::ide::api::SDKNodeDecl::diagnose(SDKNode *Right) {
|
||||
emitDiag(Loc, diag::decl_reorder, getFixedBinaryOrder(),
|
||||
RD->getFixedBinaryOrder());
|
||||
}
|
||||
if (getUsr() != RD->getUsr()) {
|
||||
auto left = demangleUSR(getUsr());
|
||||
auto right = demangleUSR(RD->getUsr());
|
||||
if (left != right) {
|
||||
emitDiag(Loc, diag::demangled_name_changed, left, right);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user