13 #ifndef LLVM_PROFILEDATA_SAMPLEPROFWRITER_H 14 #define LLVM_PROFILEDATA_SAMPLEPROFWRITER_H 27 #include <system_error> 30 namespace sampleprof {
65 virtual std::error_code
111 virtual std::error_code writeNameTable() = 0;
112 virtual std::error_code writeMagicIdent() = 0;
113 virtual std::error_code
115 std::error_code writeSummary();
116 std::error_code writeNameIdx(
StringRef FName);
118 inline void stablizeNameTable(std::set<StringRef> &V);
135 virtual std::error_code writeNameTable()
override;
136 virtual std::error_code writeMagicIdent()
override;
174 virtual std::error_code
184 virtual std::error_code writeNameTable()
override;
185 virtual std::error_code writeMagicIdent()
override;
186 virtual std::error_code
188 std::error_code writeFuncOffsetTable();
194 #endif // LLVM_PROFILEDATA_SAMPLEPROFWRITER_H
Represents either an error or a value T.
uint64_t TableOffset
The offset of the slot to be filled with the offset of FuncOffsetTable towards profile start...
This class represents lattice values for constants.
MapVector< StringRef, uint32_t > NameTable
Sample-based profile writer. Base class.
virtual ~SampleProfileWriter()=default
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)
Representation of the samples collected for a function.
MapVector< StringRef, uint64_t > FuncOffsetTable
The table mapping from function name to the offset of its FunctionSample towards profile start...
std::unique_ptr< ProfileSummary > Summary
Profile summary.
Sample-based profile writer (binary format).
raw_ostream & getOutputStream()
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"...
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.
SampleProfileWriter(std::unique_ptr< raw_ostream > &OS)
void computeSummary(const StringMap< FunctionSamples > &ProfileMap)
Compute summary for this profile.
Sample-based profile writer (text format).