+ // It is unlikely--but possible--for multiple functions to be on the same
+ // line.
+ // Therefore this typedef allows LineData.Functions to store multiple
+ // functions
+ // per instance. This is rare, however, so optimize for the common case.
+ typedef SmallVector<const GCOVFunction *, 1> FunctionVector;
+ typedef DenseMap<uint32_t, FunctionVector> FunctionLines;
+ typedef SmallVector<const GCOVBlock *, 4> BlockVector;
+ typedef DenseMap<uint32_t, BlockVector> BlockLines;
+
+ struct LineData {
+ LineData() : LastLine(0) {}
+ BlockLines Blocks;
+ FunctionLines Functions;
+ uint32_t LastLine;
+ };
+
+ struct GCOVCoverage {
+ GCOVCoverage(StringRef Name)
+ : Name(Name), LogicalLines(0), LinesExec(0), Branches(0),
+ BranchesExec(0), BranchesTaken(0) {}
+
+ StringRef Name;
+
+ uint32_t LogicalLines;
+ uint32_t LinesExec;
+
+ uint32_t Branches;
+ uint32_t BranchesExec;
+ uint32_t BranchesTaken;
+ };
+