13 #ifndef LLVM_PROFILEDATA_SAMPLEPROFWRITER_H
14 #define LLVM_PROFILEDATA_SAMPLEPROFWRITER_H
26 namespace sampleprof {
46 for (
const auto &
I : ProfileMap) {
48 if (std::error_code EC =
write(Profile))
72 virtual std::error_code
140 #endif // LLVM_PROFILEDATA_SAMPLEPROFWRITER_H
Represents either an error or a value T.
Sample-based profile writer. Base class.
This class implements a map that also provides access to all stored values in a deterministic order...
std::error_code writeHeader(const StringMap< FunctionSamples > &ProfileMap) override
Write a file header for the profile file.
std::unique_ptr< raw_ostream > OutputStream
Output stream where to emit the profile to.
SampleProfileWriterBinary(std::unique_ptr< raw_ostream > &OS)
std::error_code writeHeader(const StringMap< FunctionSamples > &ProfileMap) override
Write a file header for the profile file.
Representation of the samples collected for a function.
std::error_code writeNameIdx(StringRef FName)
std::unique_ptr< ProfileSummary > Summary
Profile summary.
virtual ~SampleProfileWriter()
Sample-based profile writer (binary format).
raw_ostream & getOutputStream()
std::error_code write(const FunctionSamples &S) override
Write samples of a top-level function to a binary file.
virtual std::error_code write(const FunctionSamples &S)=0
Write sample profiles in S.
static ErrorOr< std::unique_ptr< SampleProfileWriter > > create(StringRef Filename, SampleProfileFormat Format)
Profile writer factory.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
std::error_code writeBody(const FunctionSamples &S)
SampleProfileWriterText(std::unique_ptr< raw_ostream > &OS)
Provides ErrorOr<T> smart pointer.
virtual std::error_code writeHeader(const StringMap< FunctionSamples > &ProfileMap)=0
Write a file header for the profile file.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
std::error_code writeSummary()
SampleProfileWriter(std::unique_ptr< raw_ostream > &OS)
void computeSummary(const StringMap< FunctionSamples > &ProfileMap)
Compute summary for this profile.
std::error_code write(const FunctionSamples &S) override
Write samples to a text file.
Sample-based profile writer (text format).
std::error_code write(const StringMap< FunctionSamples > &ProfileMap)
Write all the sample profiles in the given map of samples.