+void LineLocation::print(raw_ostream &OS) const {
+ OS << LineOffset;
+ if (Discriminator > 0)
+ OS << "." << Discriminator;
+}
+
+raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS,
+ const LineLocation &Loc) {
+ Loc.print(OS);
+ return OS;
+}
+
+void LineLocation::dump() const { print(dbgs()); }
+
+void CallsiteLocation::print(raw_ostream &OS) const {
+ LineLocation::print(OS);
+ OS << ": inlined callee: " << CalleeName;
+}
+
+void CallsiteLocation::dump() const { print(dbgs()); }
+
+inline raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS,
+ const CallsiteLocation &Loc) {
+ Loc.print(OS);
+ return OS;
+}
+
+/// \brief Print the sample record to the stream \p OS indented by \p Indent.
+void SampleRecord::print(raw_ostream &OS, unsigned Indent) const {
+ OS << NumSamples;
+ if (hasCalls()) {
+ OS << ", calls:";
+ for (const auto &I : getCallTargets())
+ OS << " " << I.first() << ":" << I.second;
+ }
+ OS << "\n";
+}
+
+void SampleRecord::dump() const { print(dbgs(), 0); }
+
+raw_ostream &llvm::sampleprof::operator<<(raw_ostream &OS,
+ const SampleRecord &Sample) {
+ Sample.print(OS, 0);
+ return OS;
+}
+