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

Justin Wilson llvmlistbot at llvm.org
Sat Nov 25 07:31:54 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)>
----------------
waj334 wrote:

This is criticism I was waiting for 😄. I had reservations about adding this as a parameter directly to GlobalOp as this is not scoping information, like DICompileUnit, DILexicalBlock or DISubprogram, that implies an location. The docs clearly says `Debug scoping information is attached to LLVM IR dialect operations using a fused location (FusedLoc) whose metadata holds the DIScopeAttr representing the debug scope`, so I figured this needed to be different.

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


More information about the Mlir-commits mailing list