LLVM  3.7.0
Public Member Functions | Static Public Member Functions | List of all members
llvm::coverage::CoverageMapping Class Reference

The mapping of profile information to coverage data. More...

#include <CoverageMapping.h>

Public Member Functions

unsigned getMismatchedCount ()
 The number of functions that couldn't have their profiles mapped. More...
 
std::vector< StringRefgetUniqueSourceFiles () const
 Returns the list of files that are covered. More...
 
CoverageData getCoverageForFile (StringRef Filename)
 Get the coverage for a particular file. More...
 
iterator_range
< FunctionRecordIterator
getCoveredFunctions () const
 Gets all of the functions covered by this profile. More...
 
iterator_range
< FunctionRecordIterator
getCoveredFunctions (StringRef Filename) const
 Gets all of the functions in a particular file. More...
 
std::vector< const
FunctionRecord * > 
getInstantiations (StringRef Filename)
 Get the list of function instantiations in the file. More...
 
CoverageData getCoverageForFunction (const FunctionRecord &Function)
 Get the coverage for a particular function. More...
 
CoverageData getCoverageForExpansion (const ExpansionRecord &Expansion)
 Get the coverage for an expansion within a coverage set. More...
 

Static Public Member Functions

static ErrorOr
< std::unique_ptr
< CoverageMapping > > 
load (CoverageMappingReader &CoverageReader, IndexedInstrProfReader &ProfileReader)
 Load the coverage mapping using the given readers. More...
 
static ErrorOr
< std::unique_ptr
< CoverageMapping > > 
load (StringRef ObjectFilename, StringRef ProfileFilename, StringRef Arch=StringRef())
 Load the coverage mapping from the given files. More...
 

Detailed Description

The mapping of profile information to coverage data.

This is the main interface to get coverage information, using a profile to fill out execution counts.

Definition at line 398 of file CoverageMapping.h.

Member Function Documentation

CoverageData CoverageMapping::getCoverageForExpansion ( const ExpansionRecord Expansion)
CoverageData CoverageMapping::getCoverageForFile ( StringRef  Filename)

Get the coverage for a particular file.

The given filename must be the name as recorded in the coverage information. That is, only names returned from getUniqueSourceFiles will yield a result.

Definition at line 416 of file CoverageMapping.cpp.

References llvm::coverage::FunctionRecord::CountedRegions, llvm::dbgs(), DEBUG, findMainViewFileID(), gatherFileIDs(), isExpansion(), and sortNestedRegions().

CoverageData CoverageMapping::getCoverageForFunction ( const FunctionRecord Function)
iterator_range<FunctionRecordIterator> llvm::coverage::CoverageMapping::getCoveredFunctions ( ) const
inline

Gets all of the functions covered by this profile.

Definition at line 432 of file CoverageMapping.h.

References llvm::make_range().

Referenced by getUniqueSourceFiles().

iterator_range<FunctionRecordIterator> llvm::coverage::CoverageMapping::getCoveredFunctions ( StringRef  Filename) const
inline

Gets all of the functions in a particular file.

Definition at line 439 of file CoverageMapping.h.

References llvm::make_range().

std::vector< const FunctionRecord * > CoverageMapping::getInstantiations ( StringRef  Filename)

Get the list of function instantiations in the file.

Fucntions that are instantiated more than once, such as C++ template specializations, have distinct coverage records for each instantiation.

Definition at line 441 of file CoverageMapping.cpp.

References findMainViewFileID().

unsigned llvm::coverage::CoverageMapping::getMismatchedCount ( )
inline

The number of functions that couldn't have their profiles mapped.

This is a count of functions whose profile is out of date or otherwise can't be associated with any coverage information.

Definition at line 419 of file CoverageMapping.h.

std::vector< StringRef > CoverageMapping::getUniqueSourceFiles ( ) const

Returns the list of files that are covered.

Definition at line 355 of file CoverageMapping.cpp.

References llvm::coverage::FunctionRecord::Filenames, and getCoveredFunctions().

ErrorOr< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( CoverageMappingReader CoverageReader,
IndexedInstrProfReader ProfileReader 
)
static
ErrorOr< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( StringRef  ObjectFilename,
StringRef  ProfileFilename,
StringRef  Arch = StringRef() 
)
static

Load the coverage mapping from the given files.

Definition at line 238 of file CoverageMapping.cpp.

References llvm::coverage::BinaryCoverageReader::create(), llvm::IndexedInstrProfReader::create(), llvm::MemoryBuffer::getFileOrSTDIN(), and load().


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