[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 31 02:20:30 PST 2019


MyDeveloperDay added inline comments.


================
Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:54
+  const auto *facExpr = Result.Nodes.getNodeAs<CXXMemberCallExpr>("facCons");
+  const auto *callExpr = Result.Nodes.getNodeAs<CallExpr>("callExpr");
+
----------------
I'm not sure how expensive getNodeAs is... or if the convention is to do them all at the top of the function

but couldn't some of these getNodeAs go inside the scope where they are used

if (facExpr){
      const auto *callExpr = ....


================
Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:59
+  const auto *FC_Call = Result.Nodes.getNodeAs<CallExpr>("FC_call");
+
+  if (facExpr) {
----------------
same with the 2 above they are only used in the if (cons) scope


Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D57435





More information about the cfe-commits mailing list