[coverage] Special-case calls to noreturn functions.
authorEli Friedman <efriedma@codeaurora.org>
Tue, 8 Aug 2017 20:10:14 +0000 (20:10 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Tue, 8 Aug 2017 20:10:14 +0000 (20:10 +0000)
commit181dfe4c92ad2671a4ff5c2d91d927dd5a9958b8
tree72fb63de58b20761fd03f90d5e8617cfc1e6d071
parent8a813cf646069b88b61ef0b1177327826b0d9ec6
[coverage] Special-case calls to noreturn functions.

The code after a noreturn call doesn't execute.

The pattern in the testcase is pretty common in LLVM (a switch with
a default case that calls llvm_unreachable).

The original version of this patch was reverted in r309995 due to a
crash. This version includes a fix for that crash (testcase in
test/CoverageMapping/md.cpp).

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

llvm-svn: 310406
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/test/CoverageMapping/md.cpp
clang/test/CoverageMapping/switch.cpp