[Mlir-commits] [mlir] [mlir][python] Add `walk` method to PyOperationBase (PR #87962)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Apr 7 23:08:44 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 6fd3677fb4f4e806f2efa43bfa814aaf063c506c 77b9bbf120f5cead085fe642412a5ea3550009d2 -- mlir/lib/Bindings/Python/IRCore.cpp mlir/lib/Bindings/Python/IRModule.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp
index 848d918e16..1ee9571065 100644
--- a/mlir/lib/Bindings/Python/IRCore.cpp
+++ b/mlir/lib/Bindings/Python/IRCore.cpp
@@ -1252,8 +1252,7 @@ void PyOperationBase::writeBytecode(const py::object &fileObject,
void PyOperationBase::walk(py::object callback, bool usePreOrder) {
PyOperation &operation = getOperation();
operation.checkValid();
- MlirOperationWalkCallback walkCallback =
- [](MlirOperation op,
+ MlirOperationWalkCallback walkCallback = [](MlirOperation op,
void *userData) {
py::object *fn = static_cast<py::object *>(userData);
(*fn)(op);
@@ -3003,8 +3002,7 @@ void mlir::python::populateIRCore(py::module &m) {
py::arg("binary") = false, kOperationPrintStateDocstring)
.def("print",
py::overload_cast<std::optional<int64_t>, bool, bool, bool, bool,
- bool, py::object, bool>(
- &PyOperationBase::print),
+ bool, py::object, bool>(&PyOperationBase::print),
// Careful: Lots of arguments must match up with print method.
py::arg("large_elements_limit") = py::none(),
py::arg("enable_debug_info") = false,
``````````
</details>
https://github.com/llvm/llvm-project/pull/87962
More information about the Mlir-commits
mailing list