[Mlir-commits] [mlir] [MLIR] Add llvm (debug) attributes to CAPI (PR #83992)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Mar 5 03:25:25 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 762f762504967efbe159db5c737154b989afc9bb b2095aa81919ac89b683a4bfe51259eb0bfc946d -- mlir/include/mlir-c/BuiltinAttributes.h mlir/include/mlir-c/Dialect/LLVM.h mlir/lib/CAPI/Dialect/LLVM.cpp mlir/lib/CAPI/IR/BuiltinAttributes.cpp mlir/test/CAPI/ir.c mlir/test/CAPI/llvm.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/include/mlir-c/BuiltinAttributes.h b/mlir/include/mlir-c/BuiltinAttributes.h
index 6c323f0b2c..231eb83b5e 100644
--- a/mlir/include/mlir-c/BuiltinAttributes.h
+++ b/mlir/include/mlir-c/BuiltinAttributes.h
@@ -267,7 +267,8 @@ mlirSymbolRefAttrGetNestedReference(MlirAttribute attr, intptr_t pos);
MLIR_CAPI_EXPORTED MlirTypeID mlirSymbolRefAttrGetTypeID(void);
/// Creates a DisctinctAttr with the referenced attribute.
-MLIR_CAPI_EXPORTED MlirAttribute mlirDisctinctAttrCreate(MlirAttribute referencedAttr);
+MLIR_CAPI_EXPORTED MlirAttribute
+mlirDisctinctAttrCreate(MlirAttribute referencedAttr);
//===----------------------------------------------------------------------===//
// Flat SymbolRef attribute.
diff --git a/mlir/include/mlir-c/Dialect/LLVM.h b/mlir/include/mlir-c/Dialect/LLVM.h
index be1eac07af..7c82a30240 100644
--- a/mlir/include/mlir-c/Dialect/LLVM.h
+++ b/mlir/include/mlir-c/Dialect/LLVM.h
@@ -126,15 +126,14 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIBasicTypeAttrGet(
unsigned int encoding);
/// Creates a LLVM DICompositeType attribute.
-/* fails to compile with: error: no viable conversion from 'mlir::Attribute' to 'ValueParamT' (aka 'mlir::LLVM::DINodeAttr')
-MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDICompositeTypeAttrGet(
- MlirContext ctx, unsigned int tag, MlirAttribute name, MlirAttribute file,
- uint32_t line, MlirAttribute scope, MlirAttribute baseType, int64_t flags,
- uint64_t sizeInBits, uint64_t alignInBits, intptr_t nElements,
- MlirAttribute const *elements);
+/* fails to compile with: error: no viable conversion from 'mlir::Attribute' to
+'ValueParamT' (aka 'mlir::LLVM::DINodeAttr') MLIR_CAPI_EXPORTED MlirAttribute
+mlirLLVMDICompositeTypeAttrGet( MlirContext ctx, unsigned int tag, MlirAttribute
+name, MlirAttribute file, uint32_t line, MlirAttribute scope, MlirAttribute
+baseType, int64_t flags, uint64_t sizeInBits, uint64_t alignInBits, intptr_t
+nElements, MlirAttribute const *elements);
*/
-
/// Creates a LLVM DIDerivedType attribute.
MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDIDerivedTypeAttrGet(
MlirContext ctx, unsigned int tag, MlirAttribute name,
@@ -180,9 +179,9 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubprogramAttrGet(
uint64_t subprogramFlags, MlirAttribute type);
/// Creates a LLVM DISubroutineTypeAttr attribute.
-/* fails to compile with error: no viable conversion from 'mlir::Attribute' to 'ValueParamT' (aka 'mlir::LLVM::DITypeAttr')
-MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx,
- unsigned int callingConvention,
+/* fails to compile with error: no viable conversion from 'mlir::Attribute' to
+'ValueParamT' (aka 'mlir::LLVM::DITypeAttr') MLIR_CAPI_EXPORTED MlirAttribute
+mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx, unsigned int callingConvention,
intptr_t nTypes,
MlirAttribute const *types);
*/
diff --git a/mlir/lib/CAPI/Dialect/LLVM.cpp b/mlir/lib/CAPI/Dialect/LLVM.cpp
index 7385f18c86..ca4edf7e25 100644
--- a/mlir/lib/CAPI/Dialect/LLVM.cpp
+++ b/mlir/lib/CAPI/Dialect/LLVM.cpp
@@ -232,7 +232,8 @@ mlirLLVMDILocalVariableAttrGet(MlirContext ctx, MlirAttribute scope,
arg, alignInBits, cast<DITypeAttr>(unwrap(diType))));
}
-// fails to compile with error: no viable conversion from 'mlir::Attribute' to 'ValueParamT' (aka 'mlir::LLVM::DITypeAttr')
+// fails to compile with error: no viable conversion from 'mlir::Attribute' to
+// 'ValueParamT' (aka 'mlir::LLVM::DITypeAttr')
/*
MlirAttribute mlirLLVMDISubroutineTypeAttrGet(MlirContext ctx,
unsigned int callingConvention,
``````````
</details>
https://github.com/llvm/llvm-project/pull/83992
More information about the Mlir-commits
mailing list