Skip to content

Commit d57a8d2

Browse files
committed
Simplify ClassDecl::walkSuperclasses().
It no longer needs to worry about circular inheritance.
1 parent 6af690a commit d57a8d2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,10 +4489,9 @@ ClassDecl::findImplementingMethod(const AbstractFunctionDecl *Method) const {
44894489
bool ClassDecl::walkSuperclasses(
44904490
llvm::function_ref<TypeWalker::Action(ClassDecl *)> fn) const {
44914491

4492-
SmallPtrSet<ClassDecl *, 8> seen;
44934492
auto *cls = const_cast<ClassDecl *>(this);
44944493

4495-
while (cls && seen.insert(cls).second) {
4494+
while (cls) {
44964495
switch (fn(cls)) {
44974496
case TypeWalker::Action::Stop:
44984497
return true;

0 commit comments

Comments
 (0)