[PATCH] D69435: [clang-tidy] New checker performance-trivially-destructible-check

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 10:25:23 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:29
+  // Check direct base classes.
+  const auto *RecordDecl = Dtor->getParent();
+  for (auto *Field : RecordDecl->fields()) {
----------------
Please don't use auto unless type is spelled in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:31
+  for (auto *Field : RecordDecl->fields()) {
+    const auto FieldType = Field->getType();
+    if (FieldType->isDependentType() ||
----------------
Please don't use auto unless type is spelled in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:38
+  for (const auto &BaseSpec : RecordDecl->bases()) {
+    const auto BaseType = BaseSpec.getType();
+    if (BaseType->isDependentType() ||
----------------
Please don't use auto unless type is spelled in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:61
+  const auto *FirstDecl = cast<CXXMethodDecl>(MatchedDecl->getFirstDecl());
+  const auto FirstDeclRange = clang::CharSourceRange::getCharRange(
+      FirstDecl->getBeginLoc(),
----------------
Please don't use auto unless type is spelled in same statement or iterator.


================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:66
+          /*SkipTrailingWhitespaceAndNewLine=*/true));
+  const auto SecondDeclRange = clang::CharSourceRange::getTokenRange(
+      MatchedDecl->getBeginLoc(),
----------------
Please don't use auto unless type is spelled in same statement or iterator.


================
Comment at: clang-tools-extra/docs/ReleaseNotes.rst:133
 
+- New :doc:`performance-trivially-destructible
+  <clang-tidy/checks/performance-trivially-destructible>` check.
----------------
Please move into new checks list (in alphabetical order).


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69435/new/

https://reviews.llvm.org/D69435





More information about the cfe-commits mailing list