swift-module-digester: diagnose adding/removing final as ABI/API breakages.

This commit is contained in:
Xi Ge
2018-10-08 13:19:54 -07:00
parent bfadd46d57
commit 382e27f4ab
7 changed files with 41 additions and 20 deletions

View File

@@ -47,12 +47,17 @@ struct swift::ide::api::SDKNodeInitInfo {
};
SDKContext::SDKContext(CheckerOptions Opts): Diags(SourceMgr), Opts(Opts) {
#define ADD(NAME) ABIAttrs.push_back({DeclAttrKind::DAK_##NAME, \
#define ADD(NAME) BreakingAttrs.push_back({DeclAttrKind::DAK_##NAME, \
getAttrName(DeclAttrKind::DAK_##NAME)});
ADD(ObjC)
ADD(FixedLayout)
ADD(Frozen)
ADD(Dynamic)
// Add attributes that both break ABI and API.
ADD(Final)
if (checkingABI()) {
// Add ABI-breaking-specific attributes.
ADD(ObjC)
ADD(FixedLayout)
ADD(Frozen)
ADD(Dynamic)
}
#undef ADD
}