[clang] [clang-tools-extra] [llvm] Add ``ignoringParenImpCasts`` in arguments of hasArgument (PR #89553)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 12:23:42 PDT 2024


================
@@ -75,10 +75,11 @@ rewriteInverseDurationCall(const MatchFinder::MatchResult &Result,
       getDurationInverseForScale(Scale);
   if (const auto *MaybeCallArg = selectFirst<const Expr>(
           "e",
-          match(callExpr(callee(functionDecl(hasAnyName(
-                             InverseFunctions.first, InverseFunctions.second))),
-                         hasArgument(0, expr().bind("e"))),
-                Node, *Result.Context))) {
+          match(
+              callExpr(callee(functionDecl(hasAnyName(
+                           InverseFunctions.first, InverseFunctions.second))),
+                       hasArgument(0, ignoringParenImpCasts(expr().bind("e")))),
----------------
5chmidti wrote:

This change is not needed, the check does not care if implicit nodes are ignored or not, so we don't need to do the extra work, and it will keep the user's parentheses in-place, if they wrote them.

https://github.com/llvm/llvm-project/pull/89553


More information about the cfe-commits mailing list