Skip to content

Commit c35aa93

Browse files
committed
RequirementMachine: Add ProtocolGraph::isKnownProtocol()
1 parent 658e1f2 commit c35aa93

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/AST/RequirementMachine/ProtocolGraph.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ void ProtocolGraph::visitRequirements(ArrayRef<Requirement> reqs) {
2828
}
2929
}
3030

31+
/// Return true if we know about this protocol.
32+
bool ProtocolGraph::isKnownProtocol(const ProtocolDecl *proto) const {
33+
return Info.count(proto) > 0;
34+
}
35+
3136
/// Look up information about a known protocol.
3237
const ProtocolInfo &ProtocolGraph::getProtocolInfo(
3338
const ProtocolDecl *proto) const {

lib/AST/RequirementMachine/ProtocolGraph.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ struct ProtocolGraph {
8383

8484
void visitRequirements(ArrayRef<Requirement> reqs);
8585

86+
bool isKnownProtocol(const ProtocolDecl *proto) const;
87+
8688
const ProtocolInfo &getProtocolInfo(
8789
const ProtocolDecl *proto) const;
8890

0 commit comments

Comments
 (0)