Skip to content

[memprof] Use ListSeparator (NFC) #120047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
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
19 changes: 2 additions & 17 deletions llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,21 +896,6 @@ struct DenseMapInfo<IndexCall>

namespace {

struct FieldSeparator {
bool Skip = true;
const char *Sep;

FieldSeparator(const char *Sep = ", ") : Sep(Sep) {}
};

raw_ostream &operator<<(raw_ostream &OS, FieldSeparator &FS) {
if (FS.Skip) {
FS.Skip = false;
return OS;
}
return OS << FS.Sep;
}

// Map the uint8_t alloc types (which may contain NotCold|Cold) to the alloc
// type we should actually use on the corresponding allocation.
// If we can't clone a node that has NotCold+Cold alloc type, we will fall
Expand Down Expand Up @@ -2784,9 +2769,9 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::print(
OS << "\t\t" << *Edge << "\n";
if (!Clones.empty()) {
OS << "\tClones: ";
FieldSeparator FS;
ListSeparator LS;
for (auto *Clone : Clones)
OS << FS << Clone;
OS << LS << Clone;
OS << "\n";
} else if (CloneOf) {
OS << "\tClone of " << CloneOf << "\n";
Expand Down
Loading