]> granicus.if.org Git - clang/commit
[Coverage] The coverage region for switch covers the code after the switch.
authorAlex Lorenz <arphaman@gmail.com>
Tue, 27 Sep 2016 23:30:36 +0000 (23:30 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Tue, 27 Sep 2016 23:30:36 +0000 (23:30 +0000)
commit4d090dad54fb34c75c156acde0330782d349ae45
tree08cea9e4d5ee1abe6f980ab9fc6a7cbfceaed67e
parentc56ff5ff150460f7a5c6884ae3b1f253e39b3c35
[Coverage] The coverage region for switch covers the code after the switch.

This patch fixes a regression introduced in r262697 that changed the way the
coverage regions for switches are constructed. The PGO instrumentation counter
for a switch statement refers to the counter at the exit of the switch.
Therefore, the coverage region for the switch statement should cover the code
that comes after the switch, and not the switch statement itself.

rdar://28480997

Differential Revision: https://reviews.llvm.org/D24981

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282554 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CoverageMappingGen.cpp
test/CoverageMapping/switch.c
test/CoverageMapping/switchmacro.c