diff options
author | Aaron Puchert <aaronpuchert@alice-dsl.net> | 2020-02-29 14:22:41 +0100 |
---|---|---|
committer | Aaron Puchert <aaronpuchert@alice-dsl.net> | 2020-02-29 14:23:44 +0100 |
commit | 93184a8eda272c65308906836b47cbf209de779e (patch) | |
tree | 5667a2e57e60e238cd74fb89efb093daa7e64065 /clang/lib/AST/CXXInheritance.cpp | |
parent | 99b86d76b5e13e2257d791c66f45dd679b7bd92e (diff) | |
download | llvm-93184a8eda272c65308906836b47cbf209de779e.zip llvm-93184a8eda272c65308906836b47cbf209de779e.tar.gz llvm-93184a8eda272c65308906836b47cbf209de779e.tar.bz2 |
Remove unused parameter from CXXRecordDecl::forallBases [NFC]
Summary:
Apparently all users of the function were fine with short-circuiting
and none cared to override the default argument.
Reviewers: aaron.ballman, rsmith
Reviewed By: aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75319
Diffstat (limited to 'clang/lib/AST/CXXInheritance.cpp')
-rw-r--r-- | clang/lib/AST/CXXInheritance.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp index 0377bd32..8af9711 100644 --- a/clang/lib/AST/CXXInheritance.cpp +++ b/clang/lib/AST/CXXInheritance.cpp @@ -147,37 +147,27 @@ CXXRecordDecl::isCurrentInstantiation(const DeclContext *CurContext) const { return false; } -bool CXXRecordDecl::forallBases(ForallBasesCallback BaseMatches, - bool AllowShortCircuit) const { +bool CXXRecordDecl::forallBases(ForallBasesCallback BaseMatches) const { SmallVector<const CXXRecordDecl*, 8> Queue; const CXXRecordDecl *Record = this; - bool AllMatches = true; while (true) { for (const auto &I : Record->bases()) { const RecordType *Ty = I.getType()->getAs<RecordType>(); - if (!Ty) { - if (AllowShortCircuit) return false; - AllMatches = false; - continue; - } + if (!Ty) + return false; CXXRecordDecl *Base = cast_or_null<CXXRecordDecl>(Ty->getDecl()->getDefinition()); if (!Base || (Base->isDependentContext() && !Base->isCurrentInstantiation(Record))) { - if (AllowShortCircuit) return false; - AllMatches = false; - continue; + return false; } Queue.push_back(Base); - if (!BaseMatches(Base)) { - if (AllowShortCircuit) return false; - AllMatches = false; - continue; - } + if (!BaseMatches(Base)) + return false; } if (Queue.empty()) @@ -185,7 +175,7 @@ bool CXXRecordDecl::forallBases(ForallBasesCallback BaseMatches, Record = Queue.pop_back_val(); // not actually a queue. } - return AllMatches; + return true; } bool CXXBasePaths::lookupInBases(ASTContext &Context, |