@@ -82,23 +82,27 @@ class DebugTranslation {
82
82
llvm::DIGlobalVariable *translateImpl (DIGlobalVariableAttr attr);
83
83
llvm::DIModule *translateImpl (DIModuleAttr attr);
84
84
llvm::DINamespace *translateImpl (DINamespaceAttr attr);
85
- llvm::DIType *translateImpl (DIRecursiveTypeAttr attr);
86
85
llvm::DIScope *translateImpl (DIScopeAttr attr);
87
86
llvm::DISubprogram *translateImpl (DISubprogramAttr attr);
88
87
llvm::DISubrange *translateImpl (DISubrangeAttr attr);
89
88
llvm::DISubroutineType *translateImpl (DISubroutineTypeAttr attr);
90
89
llvm::DIType *translateImpl (DITypeAttr attr);
91
90
92
91
// / Attributes that support self recursion need to implement two methods and
93
- // / hook into the `translateImpl` method of `DIRecursiveTypeAttr`.
92
+ // / hook into the `translateImpl` overload for `DIRecursiveTypeAttr`.
94
93
// / - `<llvm type> translateImplGetPlaceholder(<mlir type>)`:
95
94
// / Translate the DI attr without translating any potentially recursive
96
95
// / nested DI attrs.
97
96
// / - `void translateImplFillPlaceholder(<mlir type>, <llvm type>)`:
98
97
// / Given the placeholder returned by `translateImplGetPlaceholder`, fill
99
98
// / any holes by recursively translating nested DI attrs. This method must
100
99
// / mutate the placeholder that is passed in, instead of creating a new one.
100
+ llvm::DIType *translateImpl (DIRecursiveTypeAttr attr);
101
+
102
+ // / Get a placeholder DICompositeType without recursing into the elements.
101
103
llvm::DICompositeType *translateImplGetPlaceholder (DICompositeTypeAttr attr);
104
+ // / Fill out the DICompositeType placeholder by recursively translating the
105
+ // / elements.
102
106
void translateImplFillPlaceholder (DICompositeTypeAttr attr,
103
107
llvm::DICompositeType *placeholder);
104
108
@@ -116,12 +120,13 @@ class DebugTranslation {
116
120
// / metadata.
117
121
DenseMap<Attribute, llvm::DINode *> attrToNode;
118
122
119
- // / A mapping from DIRecursiveTypeAttr id to the translated DIType.
123
+ // / A mapping from DistinctAttr ID of DIRecursiveTypeAttr to the translated
124
+ // / DIType.
120
125
llvm::MapVector<DistinctAttr, llvm::DIType *> recursiveTypeMap;
121
126
122
- // / A mapping between distinct ID attr for DI nodes that require distinction
123
- // / and the translate LLVM metadata node. This helps identify attrs that
124
- // / should translate into the same LLVM debug node.
127
+ // / A mapping between DistinctAttr ID and the translated LLVM metadata node.
128
+ // / This helps identify attrs that should translate into the same LLVM debug
129
+ // / node.
125
130
DenseMap<DistinctAttr, llvm::DINode *> distinctAttrToNode;
126
131
127
132
// / A mapping between filename and llvm debug file.
0 commit comments