summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-12-03 00:38:21 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-12-03 00:38:21 +0000
commit357fcf9d2ea79d43e4a1a29edb8608225c8f9a54 (patch)
tree3619d46c7a01688d748f4cbf9bd7ceb169348eab /include
parent2331c9f887346d522826175f446129d2b055d084 (diff)
downloadllvm-357fcf9d2ea79d43e4a1a29edb8608225c8f9a54.tar.gz
llvm-357fcf9d2ea79d43e4a1a29edb8608225c8f9a54.tar.bz2
llvm-357fcf9d2ea79d43e4a1a29edb8608225c8f9a54.tar.xz
llvm-cov: Store blocks rather than counts per line.
Each line stores all the blocks that execute on that line, instead of only storing the line counts previously accumulated. This provides more information for each line, and will be useful for options in enabling block and branch information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/GCOV.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/Support/GCOV.h b/include/llvm/Support/GCOV.h
index ee81229ff8..c709af5d50 100644
--- a/include/llvm/Support/GCOV.h
+++ b/include/llvm/Support/GCOV.h
@@ -250,6 +250,7 @@ public:
}
void addLine(uint32_t N) { Lines.push_back(N); }
void addCount(size_t DstEdgeNo, uint64_t N);
+ uint64_t getCount() const { return Counter; }
size_t getNumSrcEdges() const { return SrcEdges.size(); }
size_t getNumDstEdges() const { return DstEdges.size(); }
@@ -269,17 +270,18 @@ private:
SmallVector<uint32_t, 16> Lines;
};
-typedef DenseMap<uint32_t, uint64_t> LineCounts;
+typedef SmallVector<const GCOVBlock *, 4> BlockVector;
+typedef DenseMap<uint32_t, BlockVector> LineData;
class FileInfo {
public:
- void addLineCount(StringRef Filename, uint32_t Line, uint64_t Count) {
- LineInfo[Filename][Line-1] += Count;
+ void addBlockLine(StringRef Filename, uint32_t Line, const GCOVBlock *Block) {
+ LineInfo[Filename][Line-1].push_back(Block);
}
void setRunCount(uint32_t Runs) { RunCount = Runs; }
void setProgramCount(uint32_t Programs) { ProgramCount = Programs; }
void print(raw_fd_ostream &OS, StringRef gcnoFile, StringRef gcdaFile) const;
private:
- StringMap<LineCounts> LineInfo;
+ StringMap<LineData> LineInfo;
uint32_t RunCount;
uint32_t ProgramCount;
};