[Mlir-commits] [mlir] [MLIR] add C-API bindings for complex dialect (PR #173228)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Dec 22 00:58:39 PST 2025
Sergio =?utf-8?q?Sánchez_Ramírez?=,
Sergio =?utf-8?q?Sánchez_Ramírez?=,
Sergio =?utf-8?q?Sánchez_Ramírez?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/173228 at github.com>
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,cpp -- mlir/include/mlir-c/Dialect/Complex.h mlir/lib/CAPI/Dialect/Complex.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/include/mlir-c/Dialect/Complex.h b/mlir/include/mlir-c/Dialect/Complex.h
index 5c7516653..e1fa366f1 100644
--- a/mlir/include/mlir-c/Dialect/Complex.h
+++ b/mlir/include/mlir-c/Dialect/Complex.h
@@ -30,9 +30,8 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirComplexAttrDoubleGet(MlirContext ctx,
/// Same as "mlirComplexAttrDoubleGet", but if the type is not valid for a
/// construction of a ComplexAttr, returns a null MlirAttribute.
-MLIR_CAPI_EXPORTED MlirAttribute
-mlirComplexAttrDoubleGetChecked(MlirLocation loc, MlirType type, double real,
- double imag);
+MLIR_CAPI_EXPORTED MlirAttribute mlirComplexAttrDoubleGetChecked(
+ MlirLocation loc, MlirType type, double real, double imag);
/// Returns the real value stored in the given complex attribute, interpreting
/// the value as double.
diff --git a/mlir/lib/CAPI/Dialect/Complex.cpp b/mlir/lib/CAPI/Dialect/Complex.cpp
index 0b1f5e477..fc06cc3ed 100644
--- a/mlir/lib/CAPI/Dialect/Complex.cpp
+++ b/mlir/lib/CAPI/Dialect/Complex.cpp
@@ -12,7 +12,7 @@
#include "mlir/CAPI/Registration.h"
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Complex, complex,
- mlir::complex::ComplexDialect)
+ mlir::complex::ComplexDialect)
bool mlirAttributeIsAComplex(MlirAttribute attr) {
return llvm::isa<ComplexAttr>(unwrap(attr));
@@ -41,4 +41,3 @@ double mlirComplexAttrGetImagDouble(MlirAttribute attr) {
MlirTypeID mlirComplexAttrGetTypeID(void) {
return wrap(complex::NumberAttr::getTypeID());
}
-
``````````
</details>
https://github.com/llvm/llvm-project/pull/173228
More information about the Mlir-commits
mailing list