[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 21 05:22:46 PDT 2025


================
@@ -2336,16 +2336,9 @@ bool Type::isArithmeticType() const {
 }
 
 bool Type::hasBooleanRepresentation() const {
-  if (isBooleanType())
-    return true;
-
-  if (const EnumType *ET = getAs<EnumType>())
-    return ET->getDecl()->getIntegerType()->isBooleanType();
-
-  if (const AtomicType *AT = getAs<AtomicType>())
-    return AT->getValueType()->hasBooleanRepresentation();
-
-  return false;
+  if (const auto *VT = dyn_cast<VectorType>(CanonicalType))
----------------
AaronBallman wrote:

Thanks for the explanation @andykaylor!

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


More information about the cfe-commits mailing list