LLVM  3.7.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
llvm::InstrProfReader Class Referenceabstract

Base class and interface for reading profiling data of any known instrprof format. More...

#include <InstrProfReader.h>

Inheritance diagram for llvm::InstrProfReader:
[legend]

Public Member Functions

 InstrProfReader ()
 
virtual ~InstrProfReader ()
 
virtual std::error_code readHeader ()=0
 Read the header. Required before reading first record. More...
 
virtual std::error_code readNextRecord (InstrProfRecord &Record)=0
 Read a single record. More...
 
InstrProfIterator begin ()
 Iterator over profile data. More...
 
InstrProfIterator end ()
 
bool isEOF ()
 Return true if the reader has finished reading the profile data. More...
 
bool hasError ()
 Return true if the reader encountered an error reading profiling data. More...
 
std::error_code getError ()
 Get the current error code. More...
 

Static Public Member Functions

static ErrorOr
< std::unique_ptr
< InstrProfReader > > 
create (std::string Path)
 Factory method to create an appropriately typed reader for the given instrprof file. More...
 
static ErrorOr
< std::unique_ptr
< InstrProfReader > > 
create (std::unique_ptr< MemoryBuffer > Buffer)
 

Protected Member Functions

std::error_code error (std::error_code EC)
 Set the current std::error_code and return same. More...
 
std::error_code success ()
 Clear the current error code and return a successful one. More...
 

Detailed Description

Base class and interface for reading profiling data of any known instrprof format.

Provides an iterator over InstrProfRecords.

Definition at line 52 of file InstrProfReader.h.

Constructor & Destructor Documentation

llvm::InstrProfReader::InstrProfReader ( )
inline

Definition at line 56 of file InstrProfReader.h.

virtual llvm::InstrProfReader::~InstrProfReader ( )
inlinevirtual

Definition at line 57 of file InstrProfReader.h.

Member Function Documentation

InstrProfIterator llvm::InstrProfReader::begin ( )
inline

Iterator over profile data.

Definition at line 64 of file InstrProfReader.h.

ErrorOr< std::unique_ptr< InstrProfReader > > InstrProfReader::create ( std::string  Path)
static

Factory method to create an appropriately typed reader for the given instrprof file.

Definition at line 36 of file InstrProfReader.cpp.

References setupMemoryBuffer().

ErrorOr< std::unique_ptr< InstrProfReader > > InstrProfReader::create ( std::unique_ptr< MemoryBuffer Buffer)
static
InstrProfIterator llvm::InstrProfReader::end ( )
inline

Definition at line 65 of file InstrProfReader.h.

std::error_code llvm::InstrProfReader::error ( std::error_code  EC)
inlineprotected

Set the current std::error_code and return same.

Definition at line 69 of file InstrProfReader.h.

Referenced by llvm::TextInstrProfReader::readNextRecord(), and success().

std::error_code llvm::InstrProfReader::getError ( )
inline

Get the current error code.

Definition at line 83 of file InstrProfReader.h.

bool llvm::InstrProfReader::hasError ( )
inline

Return true if the reader encountered an error reading profiling data.

Definition at line 81 of file InstrProfReader.h.

References isEOF().

bool llvm::InstrProfReader::isEOF ( )
inline

Return true if the reader has finished reading the profile data.

Definition at line 79 of file InstrProfReader.h.

References llvm::eof.

Referenced by hasError().

virtual std::error_code llvm::InstrProfReader::readHeader ( )
pure virtual

Read the header. Required before reading first record.

Implemented in llvm::IndexedInstrProfReader, llvm::RawInstrProfReader< IntPtrT >, and llvm::TextInstrProfReader.

Referenced by initializeReader().

virtual std::error_code llvm::InstrProfReader::readNextRecord ( InstrProfRecord Record)
pure virtual
std::error_code llvm::InstrProfReader::success ( )
inlineprotected

Clear the current error code and return a successful one.

Definition at line 75 of file InstrProfReader.h.

References error(), and llvm::success.

Referenced by llvm::TextInstrProfReader::readHeader(), and llvm::TextInstrProfReader::readNextRecord().


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