================
@@ -58,16 +58,35 @@ void MultipleInheritanceCheck::registerMatchers(MatchFinder 
*Finder) {
 
 void MultipleInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
   const auto &D = *Result.Nodes.getNodeAs<CXXRecordDecl>("decl");
-  // Check to see if the class inherits from multiple concrete classes.
-  unsigned NumConcrete =
-      llvm::count_if(D.bases(), [&](const CXXBaseSpecifier &I) {
-        return !I.isVirtual() && !isInterface(I);
-      });
+  // Collect the direct and virtual concrete bases of the class.
----------------
zeyi2 wrote:

The initial thought was that IMO the number of base classes rarely exceeds 3, 
so we might get less heap allocs with it. But looking at the inline comments in 
`SmallVector.h` it is indeed unnecessary. Thanks.

https://github.com/llvm/llvm-project/pull/186103
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to