[Mlir-commits] [mlir] [mlir][debug] Make DICompileUnitAttr recursive. (PR #190808)
Tobias Gysi
llvmlistbot at llvm.org
Tue Apr 7 12:58:48 PDT 2026
================
@@ -330,6 +330,29 @@ DICompositeTypeAttr::getRecSelf(DistinctAttr recId) {
{}, {}, {});
}
+//===----------------------------------------------------------------------===//
+// DICompileUnitAttr
+//===----------------------------------------------------------------------===//
+
+DIRecursiveTypeAttrInterface DICompileUnitAttr::withRecId(DistinctAttr recId) {
+ return DICompileUnitAttr::get(
+ getContext(), recId, getIsRecSelf(), getId(), getSourceLanguage(),
+ getFile(), getProducer(), getIsOptimized(), getEmissionKind(),
+ getIsDebugInfoForProfiling(), getNameTableKind(), getSplitDebugFilename(),
+ getImportedEntities());
+}
+
+DIRecursiveTypeAttrInterface DICompileUnitAttr::getRecSelf(DistinctAttr recId) {
+ MLIRContext *ctx = recId.getContext();
+ auto emptyStr = StringAttr::get(ctx, "");
+ return DICompileUnitAttr::get(
+ ctx, recId, /*isRecSelf=*/true, /*id=*/DistinctAttr{},
+ llvm::dwarf::DW_LANG_C89, DIFileAttr::get(ctx, "<rec>", ""), emptyStr,
----------------
gysit wrote:
```suggestion
llvm::dwarf::DW_LANG_C89, /*file=*/{}, /*producer=*/{},
```
Ideally, we want the self recursive version to not carry any data.
https://github.com/llvm/llvm-project/pull/190808
More information about the Mlir-commits
mailing list