LLVM  5.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 "llvm/ProfileData/Coverage/CoverageMapping.h"

Public Member Functions

 CoverageMapping (const CoverageMapping &)=delete
 
CoverageMapping & operator= (const CoverageMapping &)=delete
 
unsigned getMismatchedCount ()
 The number of functions that couldn't have their profiles mapped. More...
 
std::vector< StringRef > getUniqueSourceFiles () 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 (ArrayRef< std::unique_ptr< CoverageMappingReader >> CoverageReaders, IndexedInstrProfReader &ProfileReader)
 Load the coverage mapping using the given readers. 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 437 of file CoverageMapping.h.

Constructor & Destructor Documentation

llvm::coverage::CoverageMapping::CoverageMapping ( const CoverageMapping &  )
delete

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 491 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 479 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 486 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 513 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 465 of file CoverageMapping.h.

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

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

Definition at line 445 of file CoverageMapping.cpp.

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

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

Load the coverage mapping using the given readers.

Definition at line 248 of file CoverageMapping.cpp.

References E.

Referenced by load().

Expected< std::unique_ptr< CoverageMapping > > CoverageMapping::load ( ArrayRef< StringRef >  ObjectFilenames,
StringRef  ProfileFilename,
StringRef  Arch = StringRef() 
)
static
CoverageMapping& llvm::coverage::CoverageMapping::operator= ( const CoverageMapping &  )
delete

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