mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift-module-digester: diagnose adding/removing final as ABI/API breakages.
This commit is contained in:
@@ -798,17 +798,18 @@ void swift::ide::api::SDKNodeDecl::diagnose(SDKNode *Right) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Ctx.checkingABI()) {
|
||||
// Check if some attributes with ABI-impact have been added/removed.
|
||||
for (auto &Info: Ctx.getABIAttributeInfo()) {
|
||||
if (hasDeclAttribute(Info.Kind) != RD->hasDeclAttribute(Info.Kind)) {
|
||||
auto Desc = hasDeclAttribute(Info.Kind) ?
|
||||
Ctx.buffer((llvm::Twine("without ") + Info.Content).str()):
|
||||
Ctx.buffer((llvm::Twine("with ") + Info.Content).str());
|
||||
Diags.diagnose(SourceLoc(), diag::decl_new_attr, getScreenInfo(),
|
||||
Desc);
|
||||
}
|
||||
// Check if some attributes with ABI/API-impact have been added/removed.
|
||||
for (auto &Info: Ctx.getBreakingAttributeInfo()) {
|
||||
if (hasDeclAttribute(Info.Kind) != RD->hasDeclAttribute(Info.Kind)) {
|
||||
auto Desc = hasDeclAttribute(Info.Kind) ?
|
||||
Ctx.buffer((llvm::Twine("without ") + Info.Content).str()):
|
||||
Ctx.buffer((llvm::Twine("with ") + Info.Content).str());
|
||||
Diags.diagnose(SourceLoc(), diag::decl_new_attr, getScreenInfo(),
|
||||
Desc);
|
||||
}
|
||||
}
|
||||
|
||||
if (Ctx.checkingABI()) {
|
||||
if (hasFixedBinaryOrder() && RD->hasFixedBinaryOrder() &&
|
||||
getFixedBinaryOrder() != RD->getFixedBinaryOrder()) {
|
||||
Ctx.getDiags().diagnose(SourceLoc(), diag::decl_reorder,
|
||||
|
||||
Reference in New Issue
Block a user