[Mlir-commits] [mlir] [mlir] Add support for DIGlobalVariable and DIGlobalVariableExpression (PR #73367)

Tobias Gysi llvmlistbot at llvm.org
Sat Nov 25 03:22:37 PST 2023


================
@@ -1196,7 +1197,8 @@ def LLVM_GlobalOp : LLVM_Op<"mlir.global",
       CArg<"bool", "false">:$dsoLocal,
       CArg<"bool", "false">:$thread_local_,
       CArg<"SymbolRefAttr", "{}">:$comdat,
-      CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs)>
+      CArg<"ArrayRef<NamedAttribute>", "{}">:$attrs,
+      CArg<"DIGlobalVariableExpressionAttr", "{}">:$dbgExpr)>
----------------
gysit wrote:

Can you explain why the debug expression is an argument of the GlobalOp?

I would expect that the global variable expression is stored as part of the location using a fused location. An example is the DISubprogram that is part of a function location. It is stored using a `FusedLocWith<LLVM::DISubprogramAttr>`. Something similar should be possible for the DIGlobalVariableExpressionAttr.

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


More information about the Mlir-commits mailing list