|
LLVM 24.0.0git
|
#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/BinaryFormat/Wasm.h"#include "llvm/Object/Archive.h"#include "llvm/Object/Binary.h"#include "llvm/Object/COFF.h"#include "llvm/Object/Error.h"#include "llvm/Object/MachOUniversal.h"#include "llvm/Object/ObjectFile.h"#include "llvm/Object/Wasm.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/Path.h"#include "llvm/Support/raw_ostream.h"#include "llvm/TargetParser/Triple.h"#include <vector>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 bool | shouldSkipSectionFirstByte (SectionRef &Section) |
| Determine if we should skip the first byte of the section content. | |
| static Expected< bool > | isCoverageMappingDummy (uint64_t Hash, StringRef Mapping) |
| template<typename T, llvm::endianness Endian> | |
| static Error | readCoverageMappingData (InstrProfSymtab &ProfileNames, StringRef CovMap, StringRef FuncRecords, std::vector< BinaryCoverageReader::ProfileMappingRecord > &Records, StringRef CompilationDir, std::vector< std::string > &Filenames) |
| static Expected< std::unique_ptr< BinaryCoverageReader > > | loadTestingFormat (StringRef Data, StringRef CompilationDir) |
| static Expected< std::vector< SectionRef > > | lookupSections (ObjectFile &OF, InstrProfSectKind IPSK) |
Find all sections that match IPSK name. | |
| static Expected< std::pair< StringRef, uint64_t > > | lookupAllocatableSection (ObjectFile &OF, InstrProfSectKind IPSK) |
Find a section that matches Name and is allocatable at runtime. | |
| static Expected< std::unique_ptr< BinaryCoverageReader > > | loadBinaryFormat (std::unique_ptr< Binary > Bin, StringRef Arch, StringRef CompilationDir="", object::BuildIDRef *BinaryID=nullptr) |
| static bool | isArchSpecifierInvalidOrMissing (Binary *Bin, StringRef Arch) |
Determine whether Arch is invalid or empty, given Bin. | |
Variables | |
| static const unsigned | EncodingExpansionRegionBit |
| #define DEBUG_TYPE "coverage-mapping" |
Definition at line 46 of file CoverageMappingReader.cpp.
Determine whether Arch is invalid or empty, given Bin.
Definition at line 1271 of file CoverageMappingReader.cpp.
References llvm::Bin, and llvm::dyn_cast().
Referenced by llvm::coverage::BinaryCoverageReader::create().
Definition at line 547 of file CoverageMappingReader.cpp.
References llvm::coverage::RawCoverageMappingDummyChecker::isDummy(), and uint64_t.
|
static |
Definition at line 1153 of file CoverageMappingReader.cpp.
References llvm::alignAddr(), llvm::alignTo(), assert(), llvm::big, llvm::Bin, llvm::cast(), llvm::consumeError(), llvm::copy(), llvm::InstrProfSymtab::create(), llvm::coverage::BinaryCoverageReader::createCoverageReaderFromBuffer(), llvm::dyn_cast(), E(), llvm::StringRef::empty(), llvm::errorCodeToError(), llvm::object::getBuildID(), llvm::MemoryBuffer::getMemBuffer(), llvm::MemoryBuffer::getMemBufferCopy(), llvm::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::isa(), llvm::isAddrAligned(), llvm::little, lookupAllocatableSection(), lookupSections(), llvm::make_error(), llvm::coverage::malformed, and uint64_t.
Referenced by llvm::coverage::BinaryCoverageReader::create().
|
static |
Definition at line 958 of file CoverageMappingReader.cpp.
References llvm::support::endian::byte_swap(), llvm::InstrProfSymtab::create(), llvm::coverage::BinaryCoverageReader::createCoverageReaderFromBuffer(), llvm::Data, data, llvm::decodeULEB128(), E(), llvm::MemoryBuffer::getMemBuffer(), llvm::little, llvm::make_error(), llvm::coverage::malformed, N, llvm::offsetToAlignedAddr(), llvm::coverage::TestingFormatMagic, llvm::coverage::truncated, uint64_t, llvm::coverage::unsupported_version, llvm::coverage::Version1, llvm::coverage::Version2, and llvm::coverage::Version4.
Referenced by llvm::coverage::BinaryCoverageReader::create().
|
static |
Find a section that matches Name and is allocatable at runtime.
Returns the contents of the section and its start offset in the object file.
Definition at line 1106 of file CoverageMappingReader.cpp.
References llvm::Data, llvm::wasm::DATA_SEGMENT, llvm::dyn_cast(), llvm::getInstrProfSectionName(), lookupSections(), llvm::make_error(), llvm::coverage::malformed, llvm::coverage::no_data_found, and shouldSkipSectionFirstByte().
Referenced by loadBinaryFormat().
|
static |
Find all sections that match IPSK name.
There may be more than one if comdats are in use, e.g. for the __llvm_covfun section on ELF.
Definition at line 1069 of file CoverageMappingReader.cpp.
References llvm::getInstrProfSectionName(), llvm::isa(), llvm::make_error(), N, llvm::coverage::no_data_found, and llvm::Expected< T >::takeError().
Referenced by loadBinaryFormat(), and lookupAllocatableSection().
|
static |
Definition at line 874 of file CoverageMappingReader.cpp.
References llvm::coverage::CurrentVersion, llvm::StringRef::data(), E(), llvm::Expected< T >::get(), llvm::make_error(), llvm::StringRef::size(), llvm::Error::success(), llvm::Expected< T >::takeError(), llvm::coverage::unsupported_version, and llvm::coverage::Version4.
Referenced by llvm::coverage::BinaryCoverageReader::createCoverageReaderFromBuffer().
|
static |
Determine if we should skip the first byte of the section content.
Definition at line 511 of file CoverageMappingReader.cpp.
References llvm::Triple::COFF, llvm::getInstrProfSectionName(), and llvm::isa().
Referenced by llvm::InstrProfSymtab::create(), and lookupAllocatableSection().
| STATISTIC | ( | CovMapNumRecords | , |
| "The # of coverage function records" | ) |
Definition at line 233 of file CoverageMappingReader.cpp.