swift-module-digester: include operator declarations in the module dump.

Their changes should have no impact on ABI, but can be source-breaking.
This commit is contained in:
Xi Ge
2018-10-01 12:27:59 -07:00
parent 7b03ea54ab
commit 9fcc59bcaf
7 changed files with 107 additions and 41 deletions

View File

@@ -339,12 +339,7 @@ public:
SDKNodeRoot(SDKNodeInitInfo Info);
static SDKNode *getInstance(SDKContext &Ctx);
static bool classof(const SDKNode *N);
void registerDescendant(SDKNode *D) {
if (auto DD = dyn_cast<SDKNodeDecl>(D)) {
assert(!DD->getUsr().empty());
DescendantDeclTable[DD->getUsr()].insert(DD);
}
}
void registerDescendant(SDKNode *D);
ArrayRef<SDKNodeDecl*> getDescendantsByUsr(StringRef Usr) {
return DescendantDeclTable[Usr].getArrayRef();
}
@@ -468,6 +463,12 @@ public:
void diagnose(SDKNode *Right) override;
};
class SDKNodeDeclOperator : public SDKNodeDecl {
public:
SDKNodeDeclOperator(SDKNodeInitInfo Info);
static bool classof(const SDKNode *N);
};
class SDKNodeDeclTypeAlias : public SDKNodeDecl {
public:
SDKNodeDeclTypeAlias(SDKNodeInitInfo Info);
@@ -600,13 +601,15 @@ public:
SDKNode *constructTypeDeclNode(NominalTypeDecl *NTD);
SDKNode *constructInitNode(ConstructorDecl *CD);
SDKNode *constructFunctionNode(FuncDecl* FD, SDKNodeKind Kind);
SDKNode *constructOperatorDeclNode(OperatorDecl *OD);
std::vector<SDKNode*> createParameterNodes(ParameterList *PL);
SDKNode *constructTypeNode(Type T, bool IsImplicitlyUnwrappedOptional = false,
bool hasDefaultArgument = false);
void processValueDecl(ValueDecl *VD);
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason) override;
void processDecl(Decl *D);
public:
void lookupVisibleDecls(ArrayRef<ModuleDecl *> Modules);
void processDecl(ValueDecl *VD);
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason) override;
};
int dumpSwiftModules(const CompilerInvocation &InitInvok,