diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2024-02-07 14:58:02 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2024-04-06 20:14:07 +0000 |
commit | b3edf4467982447620505a28fc82e38a414c07dc (patch) | |
tree | 3bbe0ab71c23f020abf58f17f1f43e1dcdaca7c5 /contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 868ee3f2855615016ba87c14b9444c18a2e1ba30 (diff) | |
parent | 4fdf604ba667503ae582304cebdd3df426778a6b (diff) |
Diffstat (limited to 'contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp index 5eca00f22bb8..0c43317642bc 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -1812,8 +1812,10 @@ struct CounterCoverageMappingBuilder assert(S->isConstexpr()); // evaluate constant condition... - const auto *E = cast<ConstantExpr>(S->getCond()); - const bool isTrue = E->getResultAsAPSInt().getExtValue(); + const bool isTrue = + S->getCond() + ->EvaluateKnownConstInt(CVM.getCodeGenModule().getContext()) + .getBoolValue(); extendRegion(S); |