Merge pull request #19620 from nkcsgexi/include-operator

swift-module-digester: include operator overloads in the module dump.
This commit is contained in:
Xi Ge
2018-09-28 20:35:57 -07:00
committed by GitHub
5 changed files with 108 additions and 6 deletions

View File

@@ -1151,8 +1151,6 @@ SwiftDeclCollector::shouldIgnore(Decl *D, const Decl* Parent) {
if (isa<OperatorDecl>(D))
return true;
if (auto VD = dyn_cast<ValueDecl>(D)) {
if (VD->isOperator())
return true;
if (VD->getBaseName().empty())
return true;
@@ -1347,12 +1345,12 @@ void SwiftDeclCollector::processDecl(ValueDecl *VD) {
RootNode->addChild(constructFunctionNode(FD, SDKNodeKind::DeclFunction));
} else if (auto NTD = dyn_cast<NominalTypeDecl>(VD)) {
RootNode->addChild(constructTypeDeclNode(NTD));
}
if (auto VAD = dyn_cast<VarDecl>(VD)) {
} else if (auto VAD = dyn_cast<VarDecl>(VD)) {
RootNode->addChild(constructVarNode(VAD));
}
if (auto TAD = dyn_cast<TypeAliasDecl>(VD)) {
} else if (auto TAD = dyn_cast<TypeAliasDecl>(VD)) {
RootNode->addChild(constructTypeAliasNode(TAD));
} else {
llvm_unreachable("unhandled value decl");
}
}