swift-module-digester: diagnose adding variables with fixed binary order.

Removing these variables should be detected as API breakages already.
This commit is contained in:
Xi Ge
2018-09-19 12:20:59 -07:00
parent 971755d5a3
commit b2a159dbf9
5 changed files with 19 additions and 0 deletions

View File

@@ -762,6 +762,14 @@ public:
case NodeMatchReason::Added:
assert(!Left);
Right->annotate(NodeAnnotation::Added);
if (Ctx.checkingABI()) {
if (auto *VAD = dyn_cast<SDKNodeDeclVar>(Right)) {
if (VAD->hasFixedBinaryOrder()) {
Ctx.getDiags().diagnose(SourceLoc(), diag::decl_added,
VAD->getScreenInfo());
}
}
}
return;
case NodeMatchReason::Removed:
assert(!Right);