Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ class GsymReader {
/// \param OS The output stream to dump to.
///
/// \param CSIC The CallSiteInfoCollection object to dump.
void dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC);
///
/// \param Indent The indentation as number of spaces. Used when dumping as an
/// item from within MergedFunctionsInfo.
void dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC,
uint32_t Indent = 0);

/// Dump a LineTable object.
///
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ StringMap<FunctionInfo *> CallSiteInfoLoader::buildFunctionMap() {
StringMap<FunctionInfo *> FuncMap;
for (auto &Func : Funcs) {
FuncMap.try_emplace(GCreator.getString(Func.Name), &Func);
if (auto MFuncs = Func.MergedFunctions)
if (auto &MFuncs = Func.MergedFunctions)
for (auto &MFunc : MFuncs->MergedFunctions)
FuncMap.try_emplace(GCreator.getString(MFunc.Name), &MFunc);
}
Expand Down
13 changes: 8 additions & 5 deletions llvm/lib/DebugInfo/GSYM/GsymReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ void GsymReader::dump(raw_ostream &OS, const FunctionInfo &FI,
if (FI.Inline)
dump(OS, *FI.Inline, Indent);

if (FI.CallSites)
dump(OS, *FI.CallSites, Indent);

if (FI.MergedFunctions) {
assert(Indent == 0 && "MergedFunctionsInfo should only exist at top level");
dump(OS, *FI.MergedFunctions);
}

if (FI.CallSites)
dump(OS, *FI.CallSites);
}

void GsymReader::dump(raw_ostream &OS, const MergedFunctionsInfo &MFI) {
Expand Down Expand Up @@ -454,10 +454,13 @@ void GsymReader::dump(raw_ostream &OS, const CallSiteInfo &CSI) {
}
}

void GsymReader::dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC) {
void GsymReader::dump(raw_ostream &OS, const CallSiteInfoCollection &CSIC,
uint32_t Indent) {
OS.indent(Indent);
OS << "CallSites (by relative return offset):\n";
for (const auto &CS : CSIC.CallSites) {
OS.indent(2);
OS.indent(Indent);
OS << " ";
dump(OS, CS);
OS << "\n";
}
Expand Down
Loading
Loading