[clang] [clang][CIR] Convert fixed-point values to bool enums like bool (PR #245930)

Sendao Yan via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 03:55:12 PST 2026


================
@@ -648,7 +648,7 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
       bool isPre = e->isPrefix();
 
       // Bools are always set-to-true, as decrement isn't legal on bools.
-      if (valType->isBooleanType()) {
+      if (isInc && valType->hasBooleanConversionSemantics()) {
         assert(isInc);
----------------
sendaoYan wrote:

Removed the redundant `assert(isInc)` and updated the comment. Thanks.

https://github.com/llvm/llvm-project/pull/245930


More information about the cfe-commits mailing list