Use a map instead of vector to store line counts.
authorYuchen Wu <yuchenericwu@hotmail.com>
Wed, 23 Oct 2013 19:45:03 +0000 (19:45 +0000)
committerYuchen Wu <yuchenericwu@hotmail.com>
Wed, 23 Oct 2013 19:45:03 +0000 (19:45 +0000)
commit9db9663d1d2e4e336c2787bacff4ee7125622e21
tree652abc47085c02c07ced5c8cf14ffdff53940a45
parent1e0437804c084dabda8894508f5867fdfb4df915
Use a map instead of vector to store line counts.

There are a few motivations for this:
- Using a map allows for checking if line is in map. This differentiates
  unexecutable lines (such as comments) from unexecuted logical lines of
  code. "#####" is now outputted in this case, in line with gcov.
- Source files are no longer read in twice: once when storing the line
  counts, and once when outputting the data.
- Greatly simplifies the function FileInfo::addLineCount().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193264 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/GCOV.h
lib/IR/GCOV.cpp