[clang] [clang][NFC] Refactor CodeGen's hasBooleanRepresentation (PR #134159)

Michele Scandale via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 16 13:16:15 PDT 2025


michele-scandale wrote:

> There is already a precedent (hasPointerRepresentation) for not including vectors

You cannot have vectors of pointers in the C/C++ extensions for vector types.

> Also, vectors of Booleans have different considerations that scalar Booleans. For instance, they are stored differently in memory.

The fact that the type is packed in memory does not change the fact that they represent boolean values.

> Maybe the function should have a different name to avoid confusion?

That would help to remove the confusion, but I'm not sure what could be a better name other than `isBoolOrEnumBoolOrAtomicBool`.

In parallel I'm trying to rework the function to have the same structure as `hasIntegerRepresentation`. I'll soon post a PR to see if that is acceptable. If not, then I think it would be better to rename  `hasBooleanRepresentation`. 

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


More information about the cfe-commits mailing list