[Mlir-commits] [mlir] [MLIR] Add llvm (debug) attributes to CAPI (PR #83992)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Mar 6 01:35:59 PST 2024


================
@@ -110,3 +119,222 @@ MlirLogicalResult mlirLLVMStructTypeSetBody(MlirType structType,
       cast<LLVM::LLVMStructType>(unwrap(structType))
           .setBody(unwrapList(nFieldTypes, fieldTypes, fields), isPacked));
 }
+
+MlirAttribute mlirLLVMDIExpressionElemAttrGet(MlirContext ctx,
+                                              unsigned int opcode,
+                                              intptr_t nArguments,
+                                              uint64_t const *arguments) {
+  auto list = mlir::ArrayRef<uint64_t>(arguments, nArguments);
+  return wrap(DIExpressionElemAttr::get(unwrap(ctx), opcode, list));
+}
+
+MlirAttribute mlirLLVMDIExpressionAttrGet(MlirContext ctx, intptr_t nOperations,
+                                          MlirAttribute const *operations) {
+  SmallVector<Attribute, 2> attrStorage;
----------------
ftynse wrote:

Nit: don't specify number of stack elements in a small vector unless you have a compelling reason to select a number. Here and below.

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


More information about the Mlir-commits mailing list