[clang] [NFC] [ASTMatchers] Share code of `forEachArgumentWithParamType` with UnsafeBufferUsage (PR #132387)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 21 05:25:29 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 387f3e8f986d53067a68aa0d7b058a0ce81ec941 ef63166c24f7328af8177220be706a573d97009e --extensions h,cpp -- clang/include/clang/ASTMatchers/LowLevelHelpers.h clang/lib/ASTMatchers/LowLevelHelpers.cpp clang/include/clang/ASTMatchers/ASTMatchers.h clang/lib/Analysis/UnsafeBufferUsage.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/ASTMatchers/LowLevelHelpers.cpp b/clang/lib/ASTMatchers/LowLevelHelpers.cpp
index d051430ba9..eb2604c625 100644
--- a/clang/lib/ASTMatchers/LowLevelHelpers.cpp
+++ b/clang/lib/ASTMatchers/LowLevelHelpers.cpp
@@ -77,7 +77,8 @@ static void matchEachArgumentWithParamTypeImpl(
     QualType ParamType;
     if (FProto && FProto->getNumParams() > ParamIndex)
       ParamType = FProto->getParamType(ParamIndex);
-    else if (const FunctionDecl *FD = getCallee(Node); FD && FD->getNumParams() > ParamIndex)
+    else if (const FunctionDecl *FD = getCallee(Node);
+             FD && FD->getNumParams() > ParamIndex)
       ParamType = FD->getParamDecl(ParamIndex)->getType();
     else
       continue;

``````````

</details>


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


More information about the cfe-commits mailing list