LLVM 20.0.0git
|
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Object/BuildID.h"
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
#include "llvm/ProfileData/InstrProfReader.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <iterator>
#include <map>
#include <memory>
#include <optional>
#include <stack>
#include <string>
#include <system_error>
#include <utility>
#include <vector>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "coverage-mapping" |
Functions | |
static unsigned | getMaxCounterID (const CounterMappingContext &Ctx, const CoverageMappingRecord &Record) |
static unsigned | getMaxBitmapSize (const CoverageMappingRecord &Record, bool IsVersion11) |
Returns the bit count. | |
static Error | handleMaybeNoDataFoundError (Error E) |
static SmallBitVector | gatherFileIDs (StringRef SourceFile, const FunctionRecord &Function) |
static std::optional< unsigned > | findMainViewFileID (const FunctionRecord &Function) |
Return the ID of the file where the definition of the function is located. | |
static std::optional< unsigned > | findMainViewFileID (StringRef SourceFile, const FunctionRecord &Function) |
Check if SourceFile is the file that contains the definition of the Function. | |
static bool | isExpansion (const CountedRegion &R, unsigned FileID) |
static std::string | getCoverageMapErrString (coveragemap_error Err, const std::string &ErrMsg="") |
#define DEBUG_TYPE "coverage-mapping" |
Definition at line 49 of file CoverageMapping.cpp.
|
static |
Return the ID of the file where the definition of the function is located.
Definition at line 1372 of file CoverageMapping.cpp.
References llvm::coverage::CounterMappingRegion::ExpansionRegion, llvm::SmallBitVector::find_first(), I, and llvm::Function::size().
Referenced by findMainViewFileID(), llvm::coverage::CoverageMapping::getCoverageForFile(), llvm::coverage::CoverageMapping::getCoverageForFunction(), and llvm::coverage::CoverageMapping::getInstantiationGroups().
|
static |
Check if SourceFile is the file that contains the definition of the Function.
Return the ID of the file in that case or std::nullopt otherwise.
Definition at line 1387 of file CoverageMapping.cpp.
References findMainViewFileID(), and I.
|
static |
Definition at line 1361 of file CoverageMapping.cpp.
References I, and llvm::Function::size().
Referenced by llvm::coverage::CoverageMapping::getCoverageForFile().
|
static |
Definition at line 1571 of file CoverageMapping.cpp.
References llvm::coverage::decompression_failed, llvm::coverage::eof, llvm::coverage::invalid_or_missing_arch_specifier, llvm::coverage::malformed, llvm::coverage::no_data_found, OS, llvm::coverage::success, llvm::coverage::truncated, and llvm::coverage::unsupported_version.
Referenced by llvm::coverage::CoverageMapError::message().
|
static |
Returns the bit count.
Definition at line 619 of file CoverageMapping.cpp.
References llvm::alignTo(), llvm::coverage::mcdc::DecisionParameters::BitmapIdx, llvm::coverage::CounterMappingRegion::MCDCDecisionRegion, llvm::coverage::mcdc::DecisionParameters::NumConditions, and llvm::reverse().
|
static |
Definition at line 609 of file CoverageMapping.cpp.
References llvm::coverage::CounterMappingContext::getMaxCounterID().
Definition at line 961 of file CoverageMapping.cpp.
References llvm::coverage::CoverageMapError::get(), llvm::coverage::CoverageMapError::getMessage(), llvm::handleErrors(), llvm::coverage::no_data_found, and llvm::Error::success().
|
static |
Definition at line 1394 of file CoverageMapping.cpp.
References llvm::coverage::CounterMappingRegion::ExpansionRegion.
Referenced by llvm::coverage::CoverageMapping::getCoverageForExpansion(), llvm::coverage::CoverageMapping::getCoverageForFile(), and llvm::coverage::CoverageMapping::getCoverageForFunction().