LLVM  6.0.0svn
Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::sampleprof::SampleProfileWriterBinary Class Reference

Sample-based profile writer (binary format). More...

#include "llvm/ProfileData/SampleProfWriter.h"

Inheritance diagram for llvm::sampleprof::SampleProfileWriterBinary:
Inheritance graph
Collaboration diagram for llvm::sampleprof::SampleProfileWriterBinary:
Collaboration graph

Public Member Functions

std::error_code write (const FunctionSamples &S) override
 Write samples of a top-level function to a binary file. More...
- Public Member Functions inherited from llvm::sampleprof::SampleProfileWriter
virtual ~SampleProfileWriter ()=default
std::error_code write (const StringMap< FunctionSamples > &ProfileMap)
 Write all the sample profiles in the given map of samples. More...
raw_ostreamgetOutputStream ()

Protected Member Functions

 SampleProfileWriterBinary (std::unique_ptr< raw_ostream > &OS)
std::error_code writeHeader (const StringMap< FunctionSamples > &ProfileMap) override
 Write a file header for the profile file. More...
std::error_code writeSummary ()
std::error_code writeNameIdx (StringRef FName)
std::error_code writeBody (const FunctionSamples &S)
- 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...


ErrorOr< std::unique_ptr< SampleProfileWriter > > SampleProfileWriter::create (std::unique_ptr< raw_ostream > &OS, SampleProfileFormat Format)

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...
- Protected Attributes inherited from llvm::sampleprof::SampleProfileWriter
std::unique_ptr< raw_ostreamOutputStream
 Output stream where to emit the profile to. More...
std::unique_ptr< ProfileSummarySummary
 Profile summary. More...

Detailed Description

Sample-based profile writer (binary format).

Definition at line 105 of file SampleProfWriter.h.

Constructor & Destructor Documentation

◆ SampleProfileWriterBinary()

llvm::sampleprof::SampleProfileWriterBinary::SampleProfileWriterBinary ( std::unique_ptr< raw_ostream > &  OS)

Member Function Documentation

◆ write()

std::error_code SampleProfileWriterBinary::write ( const FunctionSamples S)

Write samples of a top-level function to a binary file.

true if the samples were written successfully, false otherwise.

Implements llvm::sampleprof::SampleProfileWriter.

Definition at line 245 of file SampleProfWriter.cpp.

References llvm::encodeULEB128(), llvm::sampleprof::FunctionSamples::getHeadSamples(), and llvm::sampleprof::SampleProfileWriter::OutputStream.

◆ writeBody()

std::error_code SampleProfileWriterBinary::writeBody ( const FunctionSamples S)

◆ writeHeader()

std::error_code SampleProfileWriterBinary::writeHeader ( const StringMap< FunctionSamples > &  ProfileMap)

◆ writeNameIdx()

std::error_code SampleProfileWriterBinary::writeNameIdx ( StringRef  FName)

◆ writeSummary()

std::error_code SampleProfileWriterBinary::writeSummary ( )

Friends And Related Function Documentation

◆ SampleProfileWriter::create

ErrorOr<std::unique_ptr<SampleProfileWriter> > SampleProfileWriter::create ( std::unique_ptr< raw_ostream > &  OS,
SampleProfileFormat  Format 

The documentation for this class was generated from the following files: