[llvm] [IR] Add more efficient getOperand methods to some of the Operator subclasses. (PR #79943)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 20:36:56 PST 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 198652a0ff2553c4ba906be10c22af57d20d0bd3 bf711e11cd0184fba7348c519a7b4e7c994f3682 -- llvm/include/llvm/IR/Operator.h
``````````

</details>

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

``````````diff
diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h
index 6e81ee9870..7168128648 100644
--- a/llvm/include/llvm/IR/Operator.h
+++ b/llvm/include/llvm/IR/Operator.h
@@ -128,9 +128,8 @@ public:
 };
 
 template <>
-struct OperandTraits<OverflowingBinaryOperator> :
-  public FixedNumOperandTraits<OverflowingBinaryOperator, 2> {
-};
+struct OperandTraits<OverflowingBinaryOperator>
+    : public FixedNumOperandTraits<OverflowingBinaryOperator, 2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(OverflowingBinaryOperator, Value)
 
@@ -179,9 +178,8 @@ public:
 };
 
 template <>
-struct OperandTraits<PossiblyExactOperator> :
-  public FixedNumOperandTraits<PossiblyExactOperator, 2> {
-};
+struct OperandTraits<PossiblyExactOperator>
+    : public FixedNumOperandTraits<PossiblyExactOperator, 2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PossiblyExactOperator, Value)
 
@@ -530,9 +528,8 @@ public:
 };
 
 template <>
-struct OperandTraits<GEPOperator> :
-  public VariadicOperandTraits<GEPOperator, 1> {
-};
+struct OperandTraits<GEPOperator>
+    : public VariadicOperandTraits<GEPOperator, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GEPOperator, Value)
 
@@ -568,9 +565,8 @@ public:
 };
 
 template <>
-struct OperandTraits<PtrToIntOperator> :
-  public FixedNumOperandTraits<PtrToIntOperator, 1> {
-};
+struct OperandTraits<PtrToIntOperator>
+    : public FixedNumOperandTraits<PtrToIntOperator, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PtrToIntOperator, Value)
 
@@ -593,9 +589,8 @@ public:
 };
 
 template <>
-struct OperandTraits<BitCastOperator> :
-  public FixedNumOperandTraits<BitCastOperator, 1> {
-};
+struct OperandTraits<BitCastOperator>
+    : public FixedNumOperandTraits<BitCastOperator, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BitCastOperator, Value)
 
@@ -622,9 +617,8 @@ public:
 };
 
 template <>
-struct OperandTraits<AddrSpaceCastOperator> :
-  public FixedNumOperandTraits<AddrSpaceCastOperator, 1> {
-};
+struct OperandTraits<AddrSpaceCastOperator>
+    : public FixedNumOperandTraits<AddrSpaceCastOperator, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(AddrSpaceCastOperator, Value)
 

``````````

</details>


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


More information about the llvm-commits mailing list