Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/include/llvm/ProfileData/GCOV.h
Show First 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | private: | ||||
uint64_t Counter = 0; | uint64_t Counter = 0; | ||||
bool DstEdgesAreSorted = true; | bool DstEdgesAreSorted = true; | ||||
SmallVector<GCOVEdge *, 16> SrcEdges; | SmallVector<GCOVEdge *, 16> SrcEdges; | ||||
SmallVector<GCOVEdge *, 16> DstEdges; | SmallVector<GCOVEdge *, 16> DstEdges; | ||||
SmallVector<uint32_t, 16> Lines; | SmallVector<uint32_t, 16> Lines; | ||||
}; | }; | ||||
class FileInfo { | class FileInfo { | ||||
protected: | |||||
// It is unlikely--but possible--for multiple functions to be on the same | // It is unlikely--but possible--for multiple functions to be on the same | ||||
// line. | // line. | ||||
// Therefore this typedef allows LineData.Functions to store multiple | // Therefore this typedef allows LineData.Functions to store multiple | ||||
// functions | // functions | ||||
// per instance. This is rare, however, so optimize for the common case. | // per instance. This is rare, however, so optimize for the common case. | ||||
using FunctionVector = SmallVector<const GCOVFunction *, 1>; | using FunctionVector = SmallVector<const GCOVFunction *, 1>; | ||||
using FunctionLines = DenseMap<uint32_t, FunctionVector>; | using FunctionLines = DenseMap<uint32_t, FunctionVector>; | ||||
using BlockVector = SmallVector<const GCOVBlock *, 4>; | using BlockVector = SmallVector<const GCOVBlock *, 4>; | ||||
Show All 36 Lines | void addFunctionLine(StringRef Filename, uint32_t Line, | ||||
LineInfo[Filename].Functions[Line - 1].push_back(Function); | LineInfo[Filename].Functions[Line - 1].push_back(Function); | ||||
} | } | ||||
void setRunCount(uint32_t Runs) { RunCount = Runs; } | void setRunCount(uint32_t Runs) { RunCount = Runs; } | ||||
void setProgramCount(uint32_t Programs) { ProgramCount = Programs; } | void setProgramCount(uint32_t Programs) { ProgramCount = Programs; } | ||||
void print(raw_ostream &OS, StringRef MainFilename, StringRef GCNOFile, | void print(raw_ostream &OS, StringRef MainFilename, StringRef GCNOFile, | ||||
StringRef GCDAFile); | StringRef GCDAFile); | ||||
private: | protected: | ||||
std::string getCoveragePath(StringRef Filename, StringRef MainFilename); | std::string getCoveragePath(StringRef Filename, StringRef MainFilename); | ||||
std::unique_ptr<raw_ostream> openCoveragePath(StringRef CoveragePath); | std::unique_ptr<raw_ostream> openCoveragePath(StringRef CoveragePath); | ||||
void printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const; | void printFunctionSummary(raw_ostream &OS, const FunctionVector &Funcs) const; | ||||
void printBlockInfo(raw_ostream &OS, const GCOVBlock &Block, | void printBlockInfo(raw_ostream &OS, const GCOVBlock &Block, | ||||
uint32_t LineIndex, uint32_t &BlockNo) const; | uint32_t LineIndex, uint32_t &BlockNo) const; | ||||
void printBranchInfo(raw_ostream &OS, const GCOVBlock &Block, | void printBranchInfo(raw_ostream &OS, const GCOVBlock &Block, | ||||
GCOVCoverage &Coverage, uint32_t &EdgeNo); | GCOVCoverage &Coverage, uint32_t &EdgeNo); | ||||
void printUncondBranchInfo(raw_ostream &OS, uint32_t &EdgeNo, | void printUncondBranchInfo(raw_ostream &OS, uint32_t &EdgeNo, | ||||
Show All 21 Lines |