LLVM
8.0.1
|
#include "llvm/ProfileData/SampleProfWriter.h"
Public Member Functions | |
virtual std::error_code | write (const FunctionSamples &S) override |
Write samples of a top-level function to a binary file. More... | |
virtual std::error_code | write (const StringMap< FunctionSamples > &ProfileMap) override |
Write all the sample profiles in the given map of samples. More... | |
Public Member Functions inherited from llvm::sampleprof::SampleProfileWriterBinary | |
SampleProfileWriterBinary (std::unique_ptr< raw_ostream > &OS) | |
Public Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
virtual | ~SampleProfileWriter ()=default |
raw_ostream & | getOutputStream () |
Protected Member Functions | |
virtual std::error_code | writeNameTable () override |
virtual std::error_code | writeMagicIdent () override |
virtual std::error_code | writeHeader (const StringMap< FunctionSamples > &ProfileMap) override |
Write a file header for the profile file. More... | |
std::error_code | writeFuncOffsetTable () |
Protected Member Functions inherited from llvm::sampleprof::SampleProfileWriterBinary | |
std::error_code | writeSummary () |
std::error_code | writeNameIdx (StringRef FName) |
std::error_code | writeBody (const FunctionSamples &S) |
void | stablizeNameTable (std::set< StringRef > &V) |
Protected Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
SampleProfileWriter (std::unique_ptr< raw_ostream > &OS) | |
void | computeSummary (const StringMap< FunctionSamples > &ProfileMap) |
Compute summary for this profile. More... | |
Protected Attributes | |
MapVector< StringRef, uint64_t > | FuncOffsetTable |
The table mapping from function name to the offset of its FunctionSample towards profile start. More... | |
uint64_t | TableOffset |
The offset of the slot to be filled with the offset of FuncOffsetTable towards profile start. More... | |
Protected Attributes inherited from llvm::sampleprof::SampleProfileWriterBinary | |
MapVector< StringRef, uint32_t > | NameTable |
Protected Attributes inherited from llvm::sampleprof::SampleProfileWriter | |
std::unique_ptr< raw_ostream > | OutputStream |
Output stream where to emit the profile to. More... | |
std::unique_ptr< ProfileSummary > | Summary |
Profile summary. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::sampleprof::SampleProfileWriter | |
static ErrorOr< std::unique_ptr< SampleProfileWriter > > | create (StringRef Filename, SampleProfileFormat Format) |
Profile writer factory. More... | |
static ErrorOr< std::unique_ptr< SampleProfileWriter > > | create (std::unique_ptr< raw_ostream > &OS, SampleProfileFormat Format) |
Create a new stream writer based on the value of Format . More... | |
Definition at line 169 of file SampleProfWriter.h.
|
overridevirtual |
Write samples of a top-level function to a binary file.
Reimplemented from llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 335 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::sampleprof::FunctionSamples::getHeadSamples(), llvm::sampleprof::FunctionSamples::getName(), Name, and llvm::sampleprof::SampleProfileWriter::OutputStream.
|
overridevirtual |
Write all the sample profiles in the given map of samples.
Reimplemented from llvm::sampleprof::SampleProfileWriter.
Definition at line 69 of file SampleProfWriter.cpp.
References llvm::success, and llvm::sampleprof::SampleProfileWriter::write().
|
protected |
Definition at line 182 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), entry, llvm::support::little, llvm::ostream_seek_unsupported, llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::success, llvm::raw_ostream::tell(), and llvm::support::endian::Writer::write().
|
overrideprotectedvirtual |
Write a file header for the profile file.
Reimplemented from llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 253 of file SampleProfWriter.cpp.
References llvm::support::little, llvm::success, llvm::support::endian::Writer::write(), and llvm::sampleprof::SampleProfileWriterBinary::writeHeader().
|
overrideprotectedvirtual |
Implements llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 227 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::sampleprof::SampleProfileWriter::OutputStream, llvm::sampleprof::SPF_Compact_Binary, llvm::sampleprof::SPMagic(), llvm::sampleprof::SPVersion(), and llvm::success.
|
overrideprotectedvirtual |
Implements llvm::sampleprof::SampleProfileWriterBinary.
Definition at line 206 of file SampleProfWriter.cpp.
References llvm::encodeULEB128(), llvm::MD5Hash(), N, llvm::sampleprof::SampleProfileWriter::OutputStream, and llvm::success.
|
protected |
The table mapping from function name to the offset of its FunctionSample towards profile start.
Definition at line 180 of file SampleProfWriter.h.
|
protected |
The offset of the slot to be filled with the offset of FuncOffsetTable towards profile start.
Definition at line 183 of file SampleProfWriter.h.