[Mlir-commits] [mlir] [mlir] Add support for DIGlobalVariable and DIGlobalVariableExpression (PR #73367)
Christian Ulmann
llvmlistbot at llvm.org
Mon Nov 27 09:03:37 PST 2023
================
@@ -261,15 +262,33 @@ def LLVM_DITagParameter : LLVM_DIParameter<
"tag", /*default=*/"", "Tag"
>;
+def LLVM_DIExpressionOpcodeParameter : LLVM_DIParameter<
+ "operation encoding", /*default=*/"", "OperationEncoding"
+>;
+
//===----------------------------------------------------------------------===//
// DIExpressionAttr
//===----------------------------------------------------------------------===//
-// TODO: Implement custom printer/parser for elements so that operators are
-// dumped in textual form.
-def LLVM_DIExpressionAttr : ArrayOfAttr<LLVM_Dialect, "DIExpression",
- "di_expr", "uint64_t"> {
- let assemblyFormat = "`<` `[` (`]` `>`) : ($value^ `]` `>`)?";
+def LLVM_DIExpressionElemAttr : LLVM_Attr<"DIExpressionElem", "di_expression_elem"> {
+ let parameters = (ins
+ LLVM_DIExpressionOpcodeParameter:$opcode,
+ OptionalArrayRefParameter<"uint64_t">:$arguments);
+ let assemblyFormat = "$opcode (`(` custom<ExpressionArg>(ref($opcode), $arguments)^ `)`)?";
+}
+
+def LLVM_DIExpressionAttr : LLVM_Attr<"DIExpression", "di_expression",
+ /*traits=*/[], "MDNodeAttr"> {
+ let parameters = (ins
+ OptionalArrayRefParameter<"DIExpressionElemAttr">:$operations
+ );
+ let builders = [
+ AttrBuilder<(ins)>
+ ];
+ let constBuilderCall =
+ "::mlir::LLVM::DIExpressionAttr::get($_builder.getContext(), $0)";
+ let assemblyFormat = "`<` ( `[` $operations^ `]` )? `>`";
+ //let hasCustomAssemblyFormat = 1;
----------------
Dinistro wrote:
Development remainder?
https://github.com/llvm/llvm-project/pull/73367
More information about the Mlir-commits
mailing list