LLVM  3.7.0
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 reportParseError (int64_t LineNumber, Twine Msg) const
 Report a parse error message. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::sampleprof::SampleProfileReader
static ErrorOr
< std::unique_ptr
< SampleProfileReader > > 
create (StringRef Filename, LLVMContext &C)
 Create a sample profile reader appropriate to the file format. 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...
 

Detailed Description

Definition at line 113 of file SampleProfReader.h.

Constructor & Destructor Documentation

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

Definition at line 115 of file SampleProfReader.h.

Member Function Documentation

std::error_code SampleProfileReaderText::read ( )
overridevirtual

Read sample profiles from the associated file.

Load samples from a text file.

See the documentation at the top of the file for an explanation of the expected format.

Returns
true if the file was loaded successfully, false otherwise.

Implements llvm::sampleprof::SampleProfileReader.

Definition at line 152 of file SampleProfReader.cpp.

References llvm::sampleprof::FunctionSamples::addBodySamples(), llvm::sampleprof::FunctionSamples::addCalledTargetSamples(), llvm::sampleprof::FunctionSamples::addHeadSamples(), llvm::sampleprof::FunctionSamples::addTotalSamples(), llvm::line_iterator::is_at_eof(), llvm::line_iterator::line_number(), llvm::malformed, llvm::Regex::match(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::Regex::sub(), and llvm::success.

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

Read and validate the file header.

Implements llvm::sampleprof::SampleProfileReader.

Definition at line 119 of file SampleProfReader.h.

References llvm::success.


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