swift-module-digester: diagnose reordering of members in a fixed layout type under ABI mode.

This commit is contained in:
Xi Ge
2018-09-18 12:14:24 -07:00
parent 0eb756f2f4
commit 05e15927a3
13 changed files with 385 additions and 8 deletions

View File

@@ -220,7 +220,6 @@ class SDKNode {
std::set<NodeAnnotation> Annotations;
std::map<NodeAnnotation, StringRef> AnnotateComments;
NodePtr Parent = nullptr;
protected:
SDKNode(SDKNodeInitInfo Info, SDKNodeKind Kind);
@@ -253,7 +252,7 @@ public:
void addChild(SDKNode *Child);
ArrayRef<SDKNode*> getChildren() const;
bool hasSameChildren(const SDKNode &Other) const;
unsigned getChildIndex(NodePtr Child) const;
unsigned getChildIndex(const SDKNode *Child) const;
SDKNode* getOnlyChild() const;
SDKContext &getSDKContext() const { return Ctx; }
SDKNodeRoot *getRootNode() const;
@@ -442,9 +441,12 @@ public:
};
class SDKNodeDeclVar : public SDKNodeDecl {
Optional<unsigned> FixedBinaryOrder;
public:
SDKNodeDeclVar(SDKNodeInitInfo Info);
static bool classof(const SDKNode *N);
bool hasFixedBinaryOrder() const { return FixedBinaryOrder.hasValue(); }
unsigned getFixedBinaryOrder() const { return *FixedBinaryOrder; }
};
class SDKNodeDeclAbstractFunc : public SDKNodeDecl {
@@ -540,6 +542,7 @@ int deserializeSDKDump(StringRef dumpPath, StringRef OutputPath,
CheckerOptions Opts);
int findDeclUsr(StringRef dumpPath, CheckerOptions Opts);
} // end of abi namespace
} // end of ide namespace
} // end of Swift namespace