alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/bugprone/ParentVirtualCallCheck.cpp:24-25
+                       const CXXRecordDecl *ThisClass) {
+  assert(Parent);
+  assert(ThisClass);
+  if (Parent->getCanonicalDecl() == ThisClass->getCanonicalDecl())
----------------
aaron.ballman wrote:
> You can drop these asserts.
... and make arguments const references ;)


================
Comment at: clang-tidy/bugprone/ParentVirtualCallCheck.cpp:44
+
+static std::list<const CXXRecordDecl *>
+GetParentsByGrandParent(const CXXRecordDecl *GrandParent,
----------------
std::list is almost never a good choice due to large overhead, poor locality of 
the data, etc. Use std::vector instead.


================
Comment at: clang-tidy/bugprone/ParentVirtualCallCheck.cpp:53
+            GrandParent,
+            Base.getType()->getAsCXXRecordDecl()->getCanonicalDecl()))
+      result.push_back(
----------------
Pull this to a variable to avoid repetition.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44295



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to