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

Tobias Gysi llvmlistbot at llvm.org
Sun Mar 10 08:48:03 PDT 2024


================
@@ -346,3 +385,21 @@ StringAttr DebugImporter::getStringAttrOrNull(llvm::MDString *stringNode) {
     return StringAttr();
   return StringAttr::get(context, stringNode->getString());
 }
+
+DistinctAttr DebugImporter::getOrCreateDistinctID(llvm::DINode *node) {
+  DistinctAttr &id = nodeToDistinctAttr[node];
+  if (!id)
+    id = DistinctAttr::create(UnitAttr::get(context));
+  return id;
+}
+
+llvm::function_ref<DIRecursiveTypeAttrInterface(DistinctAttr)>
----------------
gysit wrote:

```suggestion
function_ref<DIRecursiveTypeAttrInterface(DistinctAttr)>
```
nit: I believe function_ref is available in the mlir namespace as well so the prefix may not be necessary?

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


More information about the Mlir-commits mailing list