[clang] [Clang] Loop over FieldDecls instead of all Decls (PR #99574)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 14:44:07 PDT 2024


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 4afdcd98c5e28e0b353b21bf01c5cd3568878e41 f907be4ed6189729dd2546d597dd003a5edb1006 --extensions cpp,c -- clang/lib/CodeGen/CGExpr.cpp clang/test/CodeGen/attr-counted-by.c
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 69fa05e7a9..c5341e4b53 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -1071,7 +1071,8 @@ using RecIndicesTy =
     SmallVector<std::pair<const RecordDecl *, llvm::Value *>, 8>;
 
 static bool getGEPIndicesToField(CodeGenFunction &CGF, const RecordDecl *RD,
-                                 const FieldDecl *Field, RecIndicesTy &Indices) {
+                                 const FieldDecl *Field,
+                                 RecIndicesTy &Indices) {
   const CGRecordLayout &Layout = CGF.CGM.getTypes().getCGRecordLayout(RD);
   int64_t FieldNo = -1;
   for (const FieldDecl *FD : RD->fields()) {

``````````

</details>


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


More information about the cfe-commits mailing list