[Mlir-commits] [mlir] [MLIR] Translate DIStringType. (PR #94480)

Tobias Gysi llvmlistbot at llvm.org
Wed Jun 5 08:44:48 PDT 2024


================
@@ -676,6 +676,21 @@ def LLVM_DILabelAttr : LLVM_Attr<"DILabel", "di_label",
   let assemblyFormat = "`<` struct(params) `>`";
 }
 
+def LLVM_DIStringTypeAttr : LLVM_Attr<"DIStringType", "di_string_type",
+                                     /*traits=*/[], "DITypeAttr"> {
+  let parameters = (ins
+    LLVM_DITagParameter:$tag,
+    "StringAttr":$name,
+    OptionalParameter<"uint64_t">:$sizeInBits,
+    OptionalParameter<"uint64_t">:$alignInBits,
+    OptionalParameter<"DINodeAttr">:$stringLength,
----------------
gysit wrote:

I think it would make sense to introduce DIVariableAttr in LLVMAttrs.h. Especially since this seems to exist in the LLVM class hierarchy.

When adding it is best to take DIScopeAttr, DITypeAttr, or a similar attribute as an example. There are a couple of places that need to be updated such as the DebugImport / DebugTranslation and LLVMAttrs.h / LLVMAttrs.cpp

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


More information about the Mlir-commits mailing list