LLVM  11.0.0git
Classes | Macros | Functions | Variables
CoverageMappingReader.cpp File Reference
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/COFF.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compression.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <vector>
Include dependency graph for CoverageMappingReader.cpp:

Go to the source code of this file.

Classes

struct  FilenameRange
 A range of filename indices. More...
 

Macros

#define DEBUG_TYPE   "coverage-mapping"
 

Functions

 STATISTIC (CovMapNumRecords, "The # of coverage function records")
 
 STATISTIC (CovMapNumUsedRecords, "The # of used coverage function records")
 
static Expected< boolisCoverageMappingDummy (uint64_t Hash, StringRef Mapping)
 
template<typename T , support::endianness Endian>
static Error readCoverageMappingData (InstrProfSymtab &ProfileNames, StringRef CovMap, StringRef FuncRecords, std::vector< BinaryCoverageReader::ProfileMappingRecord > &Records, std::vector< StringRef > &Filenames, BinaryCoverageReader::DecompressedData &Decompressed)
 
static Expected< std::unique_ptr< BinaryCoverageReader > > loadTestingFormat (StringRef Data)
 
static Expected< std::vector< SectionRef > > lookupSections (ObjectFile &OF, StringRef Name)
 Find all sections that match Name. More...
 
static Expected< std::unique_ptr< BinaryCoverageReader > > loadBinaryFormat (std::unique_ptr< Binary > Bin, StringRef Arch)
 

Variables

static const unsigned EncodingExpansionRegionBit
 
static const charTestingFormatMagic = "llvmcovmtestdata"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "coverage-mapping"

Definition at line 43 of file CoverageMappingReader.cpp.

Function Documentation

◆ isCoverageMappingDummy()

static Expected<bool> isCoverageMappingDummy ( uint64_t  Hash,
StringRef  Mapping 
)
static

◆ loadBinaryFormat()

static Expected<std::unique_ptr<BinaryCoverageReader> > loadBinaryFormat ( std::unique_ptr< Binary >  Bin,
StringRef  Arch 
)
static

◆ loadTestingFormat()

static Expected<std::unique_ptr<BinaryCoverageReader> > loadTestingFormat ( StringRef  Data)
static

◆ lookupSections()

static Expected<std::vector<SectionRef> > lookupSections ( ObjectFile &  OF,
StringRef  Name 
)
static

Find all sections that match Name.

There may be more than one if comdats are in use, e.g. for the __llvm_covfun section on ELF.

Definition at line 853 of file CoverageMappingReader.cpp.

References N, llvm::coverage::no_data_found, and llvm::Expected< T >::takeError().

Referenced by loadBinaryFormat().

◆ readCoverageMappingData()

template<typename T , support::endianness Endian>
static Error readCoverageMappingData ( InstrProfSymtab ProfileNames,
StringRef  CovMap,
StringRef  FuncRecords,
std::vector< BinaryCoverageReader::ProfileMappingRecord > &  Records,
std::vector< StringRef > &  Filenames,
BinaryCoverageReader::DecompressedData Decompressed 
)
static

◆ STATISTIC() [1/2]

STATISTIC ( CovMapNumRecords  ,
"The # of coverage function records"   
)

◆ STATISTIC() [2/2]

STATISTIC ( CovMapNumUsedRecords  ,
"The # of used coverage function records"   
)

Variable Documentation

◆ EncodingExpansionRegionBit

const unsigned EncodingExpansionRegionBit
static
Initial value:
= 1
<< Counter::EncodingTagBits

Definition at line 202 of file CoverageMappingReader.cpp.

◆ TestingFormatMagic

const char* TestingFormatMagic = "llvmcovmtestdata"
static

Definition at line 775 of file CoverageMappingReader.cpp.