[Mlir-commits] [llvm] [mlir] [LLVM][Support] Add `getTrailingObjects()` for single trailing type. (PR #138554)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon May 5 09:53:44 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 HEAD~1 HEAD --extensions h,cpp -- llvm/include/llvm/DebugInfo/BTF/BTF.h llvm/include/llvm/IR/DataLayout.h llvm/include/llvm/Support/TrailingObjects.h llvm/include/llvm/TableGen/Record.h llvm/lib/Bitcode/Reader/BitcodeReader.cpp llvm/lib/IR/AttributeImpl.h llvm/lib/IR/Attributes.cpp llvm/lib/Support/TrieRawHashMap.cpp llvm/lib/Transforms/IPO/LowerTypeTests.cpp llvm/unittests/Support/TrailingObjectsTest.cpp mlir/include/mlir/IR/Operation.h mlir/include/mlir/Tools/PDLL/AST/Nodes.h mlir/lib/IR/AffineMapDetail.h mlir/lib/IR/Location.cpp mlir/lib/IR/TypeDetail.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index b9245f57d..aa6672a57 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -312,9 +312,7 @@ public:
     return IsExported;
   }
 
-  ArrayRef<MDNode *> types() const {
-    return getTrailingObjects(NTypes);
-  }
+  ArrayRef<MDNode *> types() const { return getTrailingObjects(NTypes); }
 };
 
 struct ICallBranchFunnel final
diff --git a/mlir/include/mlir/Tools/PDLL/AST/Nodes.h b/mlir/include/mlir/Tools/PDLL/AST/Nodes.h
index fa4652652..9a3196155 100644
--- a/mlir/include/mlir/Tools/PDLL/AST/Nodes.h
+++ b/mlir/include/mlir/Tools/PDLL/AST/Nodes.h
@@ -400,12 +400,8 @@ public:
   Expr *getCallableExpr() const { return callable; }
 
   /// Return the arguments of this call.
-  MutableArrayRef<Expr *> getArguments() {
-    return getTrailingObjects(numArgs);
-  }
-  ArrayRef<Expr *> getArguments() const {
-    return getTrailingObjects(numArgs);
-  }
+  MutableArrayRef<Expr *> getArguments() { return getTrailingObjects(numArgs); }
+  ArrayRef<Expr *> getArguments() const { return getTrailingObjects(numArgs); }
 
   /// Returns whether the result of this call is to be negated.
   bool getIsNegated() const { return isNegated; }

``````````

</details>


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


More information about the Mlir-commits mailing list