[Mlir-commits] [mlir] [MLIR][Python] Extend bindings for external projects without duplication (PR #173241)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Dec 23 02:05:37 PST 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 origin/main HEAD --extensions cpp -- mlir/tools/mlir-tblgen/EnumPythonBindingGen.cpp mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp --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/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
index fd3a82427..fae0a5c25 100644
--- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
@@ -296,12 +296,12 @@ def {0}({2}) -> _Union[_ods_ir.OpResult, _ods_ir.OpResultList, {1}]:
static llvm::cl::OptionCategory
clPythonBindingCat("Options for -gen-python-op-bindings and "
- "-gen-python-enum-bindings");
+ "-gen-python-enum-bindings");
-llvm::cl::opt<std::string>
- clPythonPackagePrefix("python-package-prefix",
- llvm::cl::desc("The prefix of the MLIR Python package"),
- llvm::cl::init("mlir"), llvm::cl::cat(clPythonBindingCat));
+llvm::cl::opt<std::string> clPythonPackagePrefix(
+ "python-package-prefix",
+ llvm::cl::desc("The prefix of the MLIR Python package"),
+ llvm::cl::init("mlir"), llvm::cl::cat(clPythonBindingCat));
static llvm::cl::OptionCategory
clOpPythonBindingCat("Options for -gen-python-op-bindings");
@@ -1235,7 +1235,7 @@ static bool emitAllOps(const RecordKeeper &records, raw_ostream &os) {
os << formatv(fileHeader, clPythonPackagePrefix.getValue());
if (!clDialectExtensionName.empty())
os << formatv(dialectExtensionTemplate, clDialectName.getValue(),
- clPythonPackagePrefix.getValue());
+ clPythonPackagePrefix.getValue());
else
os << formatv(dialectClassTemplate, clDialectName.getValue());
``````````
</details>
https://github.com/llvm/llvm-project/pull/173241
More information about the Mlir-commits
mailing list