LLVM  4.0.0
Public Member Functions | Static Public Member Functions | List of all members
llvm::sampleprof::SampleProfileReaderText Class Reference

#include <SampleProfReader.h>

Inheritance diagram for llvm::sampleprof::SampleProfileReaderText:
[legend]
Collaboration diagram for llvm::sampleprof::SampleProfileReaderText:
[legend]

Public Member Functions

 SampleProfileReaderText (std::unique_ptr< MemoryBuffer > B, LLVMContext &C)
 
std::error_code readHeader () override
 Read and validate the file header. More...
 
std::error_code read () override
 Read sample profiles from the associated file. More...
 
- Public Member Functions inherited from llvm::sampleprof::SampleProfileReader
 SampleProfileReader (std::unique_ptr< MemoryBuffer > B, LLVMContext &C)
 
virtual ~SampleProfileReader ()
 
void dumpFunctionProfile (StringRef FName, raw_ostream &OS=dbgs())
 Print the profile for FName on stream OS. More...
 
void dump (raw_ostream &OS=dbgs())
 Print all the profiles on stream OS. More...
 
FunctionSamplesgetSamplesFor (const Function &F)
 Return the samples collected for function F. More...
 
StringMap< FunctionSamples > & getProfiles ()
 Return all the profiles. More...
 
void reportError (int64_t LineNumber, Twine Msg) const
 Report a parse error message. More...
 
ProfileSummarygetSummary ()
 Return the profile summary. More...
 

Static Public Member Functions

static bool hasFormat (const MemoryBuffer &Buffer)
 Return true if Buffer is in the format supported by this class. More...
 
- Static Public Member Functions inherited from llvm::sampleprof::SampleProfileReader
static ErrorOr
< std::unique_ptr
< SampleProfileReader > > 
create (const Twine &Filename, LLVMContext &C)
 Create a sample profile reader appropriate to the file format. More...
 
static ErrorOr
< std::unique_ptr
< SampleProfileReader > > 
create (std::unique_ptr< MemoryBuffer > &B, LLVMContext &C)
 Create a sample profile reader from the supplied memory buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::sampleprof::SampleProfileReader
void computeSummary ()
 Compute summary for this profile. More...
 
- Protected Attributes inherited from llvm::sampleprof::SampleProfileReader
StringMap< FunctionSamplesProfiles
 Map every function to its associated profile. More...
 
LLVMContextCtx
 LLVM context used to emit diagnostics. More...
 
std::unique_ptr< MemoryBufferBuffer
 Memory buffer holding the profile file. More...
 
std::unique_ptr< ProfileSummarySummary
 Profile summary information. More...
 

Detailed Description

Definition at line 322 of file SampleProfReader.h.

Constructor & Destructor Documentation

llvm::sampleprof::SampleProfileReaderText::SampleProfileReaderText ( std::unique_ptr< MemoryBuffer B,
LLVMContext C 
)
inline

Definition at line 324 of file SampleProfReader.h.

Member Function Documentation

bool SampleProfileReaderText::hasFormat ( const MemoryBuffer Buffer)
static

Return true if Buffer is in the format supported by this class.

Definition at line 228 of file SampleProfReader.cpp.

References llvm::line_iterator::is_at_eof(), and ParseHead().

Referenced by llvm::sampleprof::SampleProfileReader::create().

std::error_code SampleProfileReaderText::read ( )
overridevirtual
std::error_code llvm::sampleprof::SampleProfileReaderText::readHeader ( )
inlineoverridevirtual

Read and validate the file header.

Implements llvm::sampleprof::SampleProfileReader.

Definition at line 328 of file SampleProfReader.h.

References llvm::success.


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