mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ABI checker: diagnose the missing of @available attributes for added ABIs
New ABIs should have an @available attribute to describe the introducing version. This patch teaches the tool to diagnose its missing. Decls with @_AlwaysEmitIntoClient are excluded from the blaming lists since they are essentially available all the time. rdar://51089418
This commit is contained in:
@@ -1003,6 +1003,13 @@ public:
|
||||
if (D->hasFixedBinaryOrder()) {
|
||||
D->emitDiag(diag::decl_added);
|
||||
}
|
||||
// Diagnose the missing of @available attributes.
|
||||
// Decls with @_alwaysEmitIntoClient aren't required to have an
|
||||
// @available attribute.
|
||||
if (!D->getIntroducingVersion().hasOSAvailability() &&
|
||||
!D->hasDeclAttribute(DeclAttrKind::DAK_AlwaysEmitIntoClient)) {
|
||||
D->emitDiag(diag::new_decl_without_intro);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Complain about added protocol requirements
|
||||
@@ -1038,7 +1045,6 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
case NodeMatchReason::Removed:
|
||||
assert(!Right);
|
||||
|
||||
Reference in New Issue
Block a user