File tree Expand file tree Collapse file tree 2 files changed +0
-41
lines changed Expand file tree Collapse file tree 2 files changed +0
-41
lines changed Original file line number Diff line number Diff line change @@ -5926,16 +5926,6 @@ class ProtocolType : public NominalType {
5926
5926
// / in the protocol list, then sorting them in some stable order.
5927
5927
static void canonicalizeProtocols (SmallVectorImpl<ProtocolDecl *> &protocols);
5928
5928
5929
- // / Visit all of the protocols in the given list of protocols, along with their
5930
- // /
5931
- // / \param fn Visitor function called for each protocol (just once). If it
5932
- // / returns \c true, the visit operation will abort and return \c true.
5933
- // /
5934
- // / \returns \c true if any invocation of \c fn returns \c true, and \c false
5935
- // / otherwise.
5936
- static bool visitAllProtocols (ArrayRef<ProtocolDecl *> protocols,
5937
- llvm::function_ref<bool (ProtocolDecl *)> fn);
5938
-
5939
5929
private:
5940
5930
friend class NominalTypeDecl ;
5941
5931
ProtocolType (ProtocolDecl *TheDecl, Type Parent, const ASTContext &Ctx,
Original file line number Diff line number Diff line change @@ -1501,37 +1501,6 @@ static void addProtocols(Type T,
1501
1501
Superclass = T;
1502
1502
}
1503
1503
1504
- bool ProtocolType::visitAllProtocols (
1505
- ArrayRef<ProtocolDecl *> protocols,
1506
- llvm::function_ref<bool (ProtocolDecl *)> fn) {
1507
- SmallVector<ProtocolDecl *, 4 > stack;
1508
- SmallPtrSet<ProtocolDecl *, 4 > knownProtocols;
1509
-
1510
- // Prepopulate the stack.
1511
- for (auto proto : protocols) {
1512
- if (knownProtocols.insert (proto).second )
1513
- stack.push_back (proto);
1514
- }
1515
- std::reverse (stack.begin (), stack.end ());
1516
-
1517
- while (!stack.empty ()) {
1518
- auto proto = stack.back ();
1519
- stack.pop_back ();
1520
-
1521
- // Visit this protocol.
1522
- if (fn (proto))
1523
- return true ;
1524
-
1525
- // Add inherited protocols that we haven't seen already.
1526
- for (auto inherited : proto->getInheritedProtocols ()) {
1527
- if (knownProtocols.insert (inherited).second )
1528
- stack.push_back (inherited);
1529
- }
1530
- }
1531
-
1532
- return false ;
1533
- }
1534
-
1535
1504
static void canonicalizeProtocols (SmallVectorImpl<ProtocolDecl *> &protocols,
1536
1505
ParameterizedProtocolMap *parameterized) {
1537
1506
llvm::SmallDenseMap<ProtocolDecl *, unsigned > known;
You can’t perform that action at this time.
0 commit comments