29 using namespace llvm::sampleprof;
51 OS <<
" " << J.first() <<
":" << J.second;
90 std::string Callee = J.first();
91 unsigned CalleeSamples = J.second;
113 std::unique_ptr<SampleProfileWriter> Writer;
125 return std::move(Writer);
raw_fd_ostream OS
Output stream where to emit the profile to.
Represents either an error or a value T.
unsigned getHeadSamples() const
Return the total number of samples collected at the head of the function.
const BodySampleMap & getBodySamples() const
Return all the samples collected in the body of the function.
Sample-based profile writer. Base class.
const CallTargetMap & getCallTargets() const
Representation of the samples collected for a function.
bool write(StringRef FName, const FunctionSamples &S) override
Write samples to a text file.
Representation of a single sample record.
static uint64_t SPVersion()
Sample-based profile writer (binary format).
unsigned getTotalSamples() const
Return the total number of samples collected inside the function.
static ErrorOr< std::unique_ptr< SampleProfileWriter > > create(StringRef Filename, SampleProfileFormat Format)
Profile writer factory.
static uint64_t SPMagic()
Represents the relative location of an instruction.
bool write(StringRef F, const FunctionSamples &S) override
Write samples to a binary file.
unsigned getSamples() const
Provides ErrorOr<T> smart pointer.
void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding=0)
Utility function to encode a ULEB128 value to an output stream.
StringRef - Represent a constant reference to a string, i.e.
Sample-based profile writer (text format).
SampleProfileWriterBinary(StringRef F, std::error_code &EC)