LLVM  4.0.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 a lexicographically sorted, unique list of files that are covered. More...
 
CoverageData getCoverageForFile (StringRef Filename) const
 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) const
 Get the list of function instantiations in the file. More...
 
CoverageData getCoverageForFunction (const FunctionRecord &Function) const
 Get the coverage for a particular function. More...
 
CoverageData getCoverageForExpansion (const ExpansionRecord &Expansion) const
 Get the coverage for an expansion within a coverage set. More...
 

Static Public Member Functions

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

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 422 of file CoverageMapping.h.

Member Function Documentation

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

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 488 of file CoverageMapping.cpp.

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

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

Gets all of the functions covered by this profile.

Definition at line 475 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 482 of file CoverageMapping.h.

References llvm::make_range().

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

Get the list of function instantiations in the file.

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

Definition at line 510 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 461 of file CoverageMapping.h.

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

Returns a lexicographically sorted, unique list of files that are covered.

Definition at line 442 of file CoverageMapping.cpp.

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

Expected< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( CoverageMappingReader CoverageReader,
IndexedInstrProfReader ProfileReader 
)
static

Load the coverage mapping using the given readers.

Definition at line 235 of file CoverageMapping.cpp.

References E.

Referenced by load().

Expected< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( ArrayRef< std::unique_ptr< CoverageMappingReader >>  CoverageReaders,
IndexedInstrProfReader ProfileReader 
)
static

Definition at line 246 of file CoverageMapping.cpp.

References E.

static Expected<std::unique_ptr<CoverageMapping> > llvm::coverage::CoverageMapping::load ( StringRef  ObjectFilename,
StringRef  ProfileFilename,
StringRef  Arch = StringRef() 
)
inlinestatic

Load the coverage mapping from the given files.

Definition at line 448 of file CoverageMapping.h.

References load().

Expected< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( ArrayRef< StringRef ObjectFilenames,
StringRef  ProfileFilename,
StringRef  Arch = StringRef() 
)
static

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