[llvm] [NFC][IRBuilder] Reuse CreateGEP for helpers (PR #175979)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 14 08:11:37 PST 2026


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 origin/main HEAD --extensions h -- llvm/include/llvm/IR/IRBuilder.h --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 587ee3a3e..22af2a2cf 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -1939,13 +1939,13 @@ public:
   Value *CreateConstGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
                             const Twine &Name = "") {
     Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
-    return CreateGEP(Ty, Ptr, { Idx }, Name, GEPNoWrapFlags::none());
+    return CreateGEP(Ty, Ptr, {Idx}, Name, GEPNoWrapFlags::none());
   }
 
   Value *CreateConstInBoundsGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
                                     const Twine &Name = "") {
     Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
-    return CreateGEP(Ty, Ptr, { Idx }, Name, GEPNoWrapFlags::inBounds());
+    return CreateGEP(Ty, Ptr, {Idx}, Name, GEPNoWrapFlags::inBounds());
   }
 
   Value *CreateConstGEP2_32(Type *Ty, Value *Ptr, unsigned Idx0, unsigned Idx1,
@@ -1970,13 +1970,13 @@ public:
   Value *CreateConstGEP1_64(Type *Ty, Value *Ptr, uint64_t Idx0,
                             const Twine &Name = "") {
     Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0);
-    return CreateGEP(Ty, Ptr, { Idx }, Name, GEPNoWrapFlags::none());
+    return CreateGEP(Ty, Ptr, {Idx}, Name, GEPNoWrapFlags::none());
   }
 
   Value *CreateConstInBoundsGEP1_64(Type *Ty, Value *Ptr, uint64_t Idx0,
                                     const Twine &Name = "") {
     Value *Idx = ConstantInt::get(Type::getInt64Ty(Context), Idx0);
-    return CreateGEP(Ty, Ptr, { Idx }, Name, GEPNoWrapFlags::inBounds());
+    return CreateGEP(Ty, Ptr, {Idx}, Name, GEPNoWrapFlags::inBounds());
   }
 
   Value *CreateConstGEP2_64(Type *Ty, Value *Ptr, uint64_t Idx0, uint64_t Idx1,

``````````

</details>


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


More information about the llvm-commits mailing list