[clang] [CIR] Allow boolean operands in cir.cmp (PR #206846)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 06:34:49 PDT 2026


erichkeane wrote:

> This seems OK, but I wonder if it's the right place for the fix. If I perform a comparison with `bool` value, the AST contains a cast to an `int`. I'm curious why that doesn't happen in the enum case. Assuming there's a good reason for that, is representing the enum value as `!cir.bool` the right thing for us to be doing?

I've mentioned a few times that we should be representing enums as their own CIR types.  I suspect it'll be useful in the future.  I'm not sure we are at the moment where we SHOULD do it (though we seem to be chasing down a TON of "oh, we treated them as a bool, we need to fix that" problems right now), but it is a fairly sizable change I suspect.

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


More information about the cfe-commits mailing list