llvm-cov: Fix handling of line zero appearing in a line table
authorJustin Bogner <mail@justinbogner.com>
Fri, 2 May 2014 20:01:24 +0000 (20:01 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 2 May 2014 20:01:24 +0000 (20:01 +0000)
commit688567e91cf42fcffec70eb8abf2c6c31b7add4a
treebee1f6787ee72f4f7990458ab14d663cd291b528
parent1913eeb38536036a256ca96591dbc0f76e4bcf12
llvm-cov: Fix handling of line zero appearing in a line table

Reading line tables in llvm-cov was pretty broken, but would happen to
work as long as no line in the table was 0. It's not clear to me
whether a line of zero *should* show up in these tables, but deciding
to read a string in the middle of the line table is certainly the
wrong thing to do if it does.

I've also added some comments, as trying to figure out what this block
of code was doing was fairly unpleasant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207866 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/GCOV.cpp
test/tools/llvm-cov/Inputs/range_based_for.gcda [new file with mode: 0644]
test/tools/llvm-cov/Inputs/range_based_for.gcno [new file with mode: 0644]
test/tools/llvm-cov/lit.local.cfg
test/tools/llvm-cov/range_based_for.cpp [new file with mode: 0644]