swift-module-digester: exclude fixed binary order when checking API stability.

This commit is contained in:
Xi Ge
2018-10-08 13:59:30 -07:00
parent 847aa9b327
commit c8c7fb39b0
5 changed files with 9 additions and 10 deletions

View File

@@ -281,7 +281,6 @@
"moduleName": "cake",
"static": true,
"isOpen": true,
"fixedbinaryorder": 0,
"funcSelfKind": "NonMutating"
},
{
@@ -363,7 +362,6 @@
"HasInitialValue",
"ReferenceOwnership"
],
"fixedbinaryorder": 0,
"ownership": 1,
"hasStorage": true
},
@@ -430,7 +428,6 @@
"HasInitialValue",
"ReferenceOwnership"
],
"fixedbinaryorder": 1,
"ownership": 2,
"hasStorage": true
},
@@ -566,8 +563,7 @@
],
"declKind": "EnumElement",
"usr": "s:4cake6NumberO3oneyA2CmF",
"moduleName": "cake",
"fixedbinaryorder": 0
"moduleName": "cake"
},
{
"kind": "TypeAlias",
@@ -830,7 +826,6 @@
"declAttributes": [
"HasInitialValue"
],
"fixedbinaryorder": 0,
"hasStorage": true
},
{

View File

@@ -33,7 +33,6 @@
"declAttributes": [
"ObjC"
],
"fixedbinaryorder": 0,
"funcSelfKind": "NonMutating"
},
{

View File

@@ -1003,7 +1003,10 @@ static Optional<uint8_t> getSimilarMemberCount(NominalTypeDecl *NTD,
return std::count_if(Members.begin(), End, Check);
}
static Optional<uint8_t> getFixedBinaryOrder(ValueDecl *VD) {
Optional<uint8_t> SDKContext::getFixedBinaryOrder(ValueDecl *VD) const {
// We don't need fixed binary order when checking API stability.
if (!checkingABI())
return None;
auto *NTD = dyn_cast_or_null<NominalTypeDecl>(VD->getDeclContext()->
getAsDecl());
@@ -1090,7 +1093,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, ValueDecl *VD)
IsOpen = Ctx.getAccessLevel(VD) == AccessLevel::Open;
IsInternal = Ctx.getAccessLevel(VD) < AccessLevel::Public;
SelfIndex = getSelfIndex(VD);
FixedBinaryOrder = getFixedBinaryOrder(VD);
FixedBinaryOrder = Ctx.getFixedBinaryOrder(VD);
ReferenceOwnership = getReferenceOwnership(VD);
// Calculate usr for its super class.

View File

@@ -192,7 +192,7 @@ public:
const CheckerOptions &getOpts() const { return Opts; }
bool shouldIgnore(Decl *D, const Decl* Parent = nullptr) const;
ArrayRef<BreakingAttributeInfo> getBreakingAttributeInfo() const { return BreakingAttrs; }
Optional<uint8_t> getFixedBinaryOrder(ValueDecl *VD) const;
template<class YAMLNodeTy, typename ...ArgTypes>
void diagnose(YAMLNodeTy node, Diag<ArgTypes...> ID,
typename detail::PassArgument<ArgTypes>::type... args) {

View File

@@ -1936,6 +1936,8 @@ class RenameDetectorForMemberDiff : public MatchedNodeListener {
public:
RenameDetectorForMemberDiff(): LeftDetector(true), RightDetector(false) {}
void foundMatch(NodePtr Left, NodePtr Right, NodeMatchReason Reason) override {
if (!Left || !Right)
return;
detectRename(Left, Right);
LeftDetector.detect(Left, Right);
RightDetector.detect(Right, Left);