#include "llvm/ProfileData/GCOV.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <optional>
#include <system_error>
usingnamespacellvm;
enum : uint32_t { … };
namespace {
struct Summary { … };
struct LineInfo { … };
struct SourceInfo { … };
class Context { … };
}
bool GCOVFile::readGCNO(GCOVBuffer &buf) { … }
bool GCOVFile::readGCDA(GCOVBuffer &buf) { … }
void GCOVFile::print(raw_ostream &OS) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void GCOVFile::dump() const { print(dbgs()); }
#endif
unsigned GCOVFile::addNormalizedPathToMap(StringRef filename) { … }
bool GCOVArc::onTree() const { … }
StringRef GCOVFunction::getName(bool demangle) const { … }
StringRef GCOVFunction::getFilename() const { … }
uint64_t GCOVFunction::getEntryCount() const { … }
GCOVBlock &GCOVFunction::getExitBlock() const { … }
void GCOVFunction::propagateCounts(const GCOVBlock &v, GCOVArc *pred) { … }
void GCOVFunction::print(raw_ostream &OS) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void GCOVFunction::dump() const { print(dbgs()); }
#endif
void GCOVBlock::print(raw_ostream &OS) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void GCOVBlock::dump() const { print(dbgs()); }
#endif
uint64_t
GCOVBlock::augmentOneCycle(GCOVBlock *src,
std::vector<std::pair<GCOVBlock *, size_t>> &stack) { … }
uint64_t GCOVBlock::getCyclesCount(const BlockVector &blocks) { … }
static uint32_t formatPercentage(uint64_t dividend, uint64_t divisor) { … }
static uint32_t branchDiv(uint64_t Numerator, uint64_t Divisor) { … }
namespace {
struct formatBranchInfo { … };
static raw_ostream &operator<<(raw_ostream &OS, const formatBranchInfo &FBI) { … }
class LineConsumer { … };
}
static std::string mangleCoveragePath(StringRef Filename, bool PreservePaths) { … }
std::string Context::getCoveragePath(StringRef filename,
StringRef mainFilename) const { … }
void Context::collectFunction(GCOVFunction &f, Summary &summary) { … }
void Context::collectSourceLine(SourceInfo &si, Summary *summary,
LineInfo &line, size_t lineNum) const { … }
void Context::collectSource(SourceInfo &si, Summary &summary) const { … }
void Context::annotateSource(SourceInfo &si, const GCOVFile &file,
StringRef gcno, StringRef gcda,
raw_ostream &os) const { … }
void Context::printSourceToIntermediate(const SourceInfo &si,
raw_ostream &os) const { … }
void Context::print(StringRef filename, StringRef gcno, StringRef gcda,
GCOVFile &file) { … }
void Context::printFunctionDetails(const GCOVFunction &f,
raw_ostream &os) const { … }
void Context::printBranchInfo(const GCOVBlock &Block, uint32_t &edgeIdx,
raw_ostream &os) const { … }
void Context::printSummary(const Summary &summary, raw_ostream &os) const { … }
void llvm::gcovOneInput(const GCOV::Options &options, StringRef filename,
StringRef gcno, StringRef gcda, GCOVFile &file) { … }