================ @@ -1808,12 +1808,24 @@ struct CounterCoverageMappingBuilder } } +private: + static bool evaluateConstantCondition(const Expr *Condition) { + if (const auto *Expr = dyn_cast<ConstantExpr>(Condition)) + return Expr->getResultAsAPSInt().getExtValue(); + + if (const auto *Expr = dyn_cast<ExprWithCleanups>(Condition)) + return evaluateConstantCondition(Expr->getSubExpr()); // recursion + + assert(false && "Unexpected node in 'if constexpr' condition"); + return false; + } + +public: ---------------- hanickadot wrote:
I'm still a bit new here and I'm confused... `CoverageMappingGen.cpp` doesn't have any mention of ASTContext which is an argument for functions mentioned by @efriedma-quic is there an easy way how to get it. Or do I need to go another direction? https://github.com/llvm/llvm-project/pull/80292 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits