[Clang] Fix crash in coverage of if consteval.
authorCorentin Jabot <corentinjabot@gmail.com>
Fri, 26 Aug 2022 08:20:12 +0000 (10:20 +0200)
committerCorentin Jabot <corentinjabot@gmail.com>
Fri, 26 Aug 2022 15:46:53 +0000 (17:46 +0200)
commit463e30f51fd07921f32c6630afb3f8dd18d6d2f5
treed8e7767e02b2efaa05b25d4085fb449ecab3baf7
parent98f6a56f5ea2fc4ae7f4283b97073667a9e32cde
[Clang] Fix crash in coverage of if consteval.

Clang crashes when encountering an `if consteval` statement.
This is the minimum fix not to crash.
The fix is consistent with the current behavior of if constexpr,
which does generate coverage data for the discarded branches.
This is of course not correct and a better solution is
needed for both if constexpr and if consteval.
See https://github.com/llvm/llvm-project/issues/54419.

Fixes #57377

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D132723
clang/docs/ReleaseNotes.rst
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/test/CoverageMapping/if.cpp