@@ -217,26 +217,18 @@ DIInliningInfo SymbolizableObjectFile::symbolizeInlinedCode(
217
217
if (InlinedContext.getNumberOfFrames () == 0 )
218
218
InlinedContext.addFrame (DILineInfo ());
219
219
220
- if (FNKind != FunctionNameKind::LinkageName || !UseSymbolTable)
221
- return InlinedContext;
222
-
223
220
// Override the function name in lower frame with name from symbol table.
224
- // We can't directly change the last element of DIInliningInfo, so copy
225
- // all frames into new context, replacing function name in the last one.
226
- DIInliningInfo PatchedInlinedContext;
227
- for (uint32_t i = 0 , n = InlinedContext.getNumberOfFrames (); i < n; i++) {
228
- DILineInfo LineInfo = InlinedContext.getFrame (i);
229
- if (i == n - 1 ) {
230
- std::string FunctionName;
231
- uint64_t Start, Size ;
232
- if (getNameFromSymbolTable (SymbolRef::ST_Function, ModuleOffset,
233
- FunctionName, Start, Size )) {
234
- LineInfo.FunctionName = FunctionName;
235
- }
221
+ if (FNKind == FunctionNameKind::LinkageName && UseSymbolTable) {
222
+ std::string FunctionName;
223
+ uint64_t Start, Size ;
224
+ if (getNameFromSymbolTable (SymbolRef::ST_Function, ModuleOffset,
225
+ FunctionName, Start, Size )) {
226
+ InlinedContext.getMutableFrame (InlinedContext.getNumberOfFrames () - 1 )
227
+ ->FunctionName = FunctionName;
236
228
}
237
- PatchedInlinedContext.addFrame (LineInfo);
238
229
}
239
- return PatchedInlinedContext;
230
+
231
+ return InlinedContext;
240
232
}
241
233
242
234
DIGlobal SymbolizableObjectFile::symbolizeData (uint64_t ModuleOffset) const {
0 commit comments