swift-module-digester: diagnose self access kind changes for function decls.

This commit is contained in:
Xi Ge
2018-10-04 12:25:15 -07:00
parent f2bdce8251
commit 78271f19a0
11 changed files with 115 additions and 60 deletions

View File

@@ -509,7 +509,6 @@ public:
class SDKNodeDeclAbstractFunc : public SDKNodeDecl {
bool IsThrowing;
bool IsMutating;
Optional<uint8_t> SelfIndex;
protected:
@@ -517,7 +516,6 @@ protected:
virtual ~SDKNodeDeclAbstractFunc() = default;
public:
bool isThrowing() const { return IsThrowing; }
bool isMutating() const { return IsMutating; }
uint8_t getSelfIndex() const { return SelfIndex.getValue(); }
Optional<uint8_t> getSelfIndexOptional() const { return SelfIndex; }
bool hasSelfIndex() const { return SelfIndex.hasValue(); }
@@ -540,10 +538,14 @@ public:
};
class SDKNodeDeclFunction: public SDKNodeDeclAbstractFunc {
StringRef FuncSelfKind;
public:
SDKNodeDeclFunction(SDKNodeInitInfo Info);
SDKNode *getReturnType() { return *getChildBegin(); }
StringRef getSelfAccessKind() const { return FuncSelfKind; }
static bool classof(const SDKNode *N);
void jsonize(json::Output &Out) override;
void diagnose(SDKNode *Right) override;
};
class SDKNodeDeclConstructor: public SDKNodeDeclAbstractFunc {