aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageView.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-08-04 00:29:20 +0000
committerVedant Kumar <vsk@apple.com>2017-08-04 00:29:20 +0000
commit85e6dce1ebfc714b975a023e59054ab2bdc979bc (patch)
tree6ba1f096bcc98e05ea873cc65e26f8640f84cf3c /llvm/tools/llvm-cov/SourceCoverageView.cpp
parent5bd0503680935112f63d0277748ecd9a112a7467 (diff)
downloadllvm-85e6dce1ebfc714b975a023e59054ab2bdc979bc.zip
llvm-85e6dce1ebfc714b975a023e59054ab2bdc979bc.tar.gz
llvm-85e6dce1ebfc714b975a023e59054ab2bdc979bc.tar.bz2
[Coverage] Precise region termination with deferred regions
The current coverage implementation doesn't handle region termination very precisely. Take for example an `if' statement with a `return': void f() { if (true) { return; // The `if' body's region is terminated here. } // This line gets the same coverage as the `if' condition. } If the function `f' is called, the line containing the comment will be marked as having executed once, which is not correct. The solution here is to create a deferred region after terminating a region. The deferred region is completed once the start location of the next statement is known, and is then pushed onto the region stack. In the cases where it's not possible to complete a deferred region, it can safely be dropped. Testing: lit test updates, a stage2 coverage-enabled build of clang llvm-svn: 310010
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.cpp')
0 files changed, 0 insertions, 0 deletions