[Mlir-commits] [mlir] [MLIR][LLVM] Support Recursive DITypes (PR #80251)

Tobias Gysi llvmlistbot at llvm.org
Thu Feb 29 12:07:05 PST 2024


================
@@ -289,7 +319,20 @@ DINodeAttr DebugImporter::translate(llvm::DINode *node) {
     return nullptr;
   };
   if (DINodeAttr attr = translateNode(node)) {
-    nodeToAttr.insert({node, attr});
+    // If this node was marked as recursive, wrap with a recursive type.
+    if (typeNode) {
+      if (DistinctAttr id = typeTranslationStack.lookup(typeNode)) {
+        DITypeAttr typeAttr = cast<DITypeAttr>(attr);
+        attr = DIRecursiveTypeAttr::get(context, id, typeAttr);
+
+        // Remove the unbound recursive attr.
----------------
gysit wrote:

```suggestion
        // Remove the unbound recursive DistinctAttr ID.
```

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


More information about the Mlir-commits mailing list