diff options
author | Bob Wilson <bob.wilson@apple.com> | 2013-10-22 17:43:47 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2013-10-22 17:43:47 +0000 |
commit | 51ec77d880ce53cbc8a48168185edc085df9b6d9 (patch) | |
tree | cd8ac30429d51373df6f95a0ce78a3570961972b /include/llvm/Support/GCOV.h | |
parent | 135fe6ac5f5b80ef68c19b3ec7bb0063e28f2bab (diff) | |
download | external_llvm-51ec77d880ce53cbc8a48168185edc085df9b6d9.zip external_llvm-51ec77d880ce53cbc8a48168185edc085df9b6d9.tar.gz external_llvm-51ec77d880ce53cbc8a48168185edc085df9b6d9.tar.bz2 |
Fix llvm-cov counts to be 64-bit integers to avoid overflows.
Line counts in llvm-cov are read in as 64-bit integers but were being truncated
to 32-bit in collectLineCounts(), which caused overflow for large counts.
This patch fixes all counts to be uint64_t.
Patch by Yuchen Wu!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/GCOV.h')
-rw-r--r-- | include/llvm/Support/GCOV.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/GCOV.h b/include/llvm/Support/GCOV.h index 67d6370..aa436fb 100644 --- a/include/llvm/Support/GCOV.h +++ b/include/llvm/Support/GCOV.h @@ -205,17 +205,17 @@ class GCOVLines { public: ~GCOVLines() { Lines.clear(); } void add(uint32_t N) { Lines.push_back(N); } - void collectLineCounts(FileInfo &FI, StringRef Filename, uint32_t Count); + void collectLineCounts(FileInfo &FI, StringRef Filename, uint64_t Count); void dump(); private: SmallVector<uint32_t, 4> Lines; }; -typedef SmallVector<uint32_t, 16> LineCounts; +typedef SmallVector<uint64_t, 16> LineCounts; class FileInfo { public: - void addLineCount(StringRef Filename, uint32_t Line, uint32_t Count); + void addLineCount(StringRef Filename, uint32_t Line, uint64_t Count); void print(StringRef gcnoFile, StringRef gcdaFile); private: StringMap<LineCounts> LineInfo; |