Skip to content

Commit 1b8b974

Browse files
author
Alex B
committed
[llvm-gsymutil] Improve dumping of callsites for merged functions
1 parent 92a15dd commit 1b8b974

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

llvm/include/llvm/DebugInfo/GSYM/GsymReader.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ class GsymReader {
199199
/// \param OS The output stream to dump to.
200200
///
201201
/// \param CSIC The CallSiteInfoCollection object to dump.
202-
void dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC);
202+
///
203+
/// \param Indent The indentation as number of spaces. Used when dumping as an
204+
/// item from within MergedFunctionsInfo.
205+
void dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC, uint32_t Indent = 0);
203206

204207
/// Dump a LineTable object.
205208
///

llvm/lib/DebugInfo/GSYM/GsymReader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,13 @@ void GsymReader::dump(raw_ostream &OS, const FunctionInfo &FI,
406406
if (FI.Inline)
407407
dump(OS, *FI.Inline, Indent);
408408

409+
if (FI.CallSites)
410+
dump(OS, *FI.CallSites, Indent);
411+
409412
if (FI.MergedFunctions) {
410413
assert(Indent == 0 && "MergedFunctionsInfo should only exist at top level");
411414
dump(OS, *FI.MergedFunctions);
412415
}
413-
414-
if (FI.CallSites)
415-
dump(OS, *FI.CallSites);
416416
}
417417

418418
void GsymReader::dump(raw_ostream &OS, const MergedFunctionsInfo &MFI) {
@@ -454,10 +454,10 @@ void GsymReader::dump(raw_ostream &OS, const CallSiteInfo &CSI) {
454454
}
455455
}
456456

457-
void GsymReader::dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC) {
457+
void GsymReader::dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC, uint32_t Indent) {
458458
OS << "CallSites (by relative return offset):\n";
459459
for (const auto &CS : CSIC.CallSites) {
460-
OS.indent(2);
460+
OS.indent(Indent);
461461
dump(OS, CS);
462462
OS << "\n";
463463
}

0 commit comments

Comments
 (0)