[clang] [clang] Implement -fstrict-bool (PR #160790)

Bruno De Fraine via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 22:24:37 PDT 2025


=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/160790 at github.com>


================
@@ -2198,8 +2211,16 @@ llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) {
   }
 
   llvm::Type *ResTy = ConvertType(Ty);
-  if (Ty->hasBooleanRepresentation() || Ty->isBitIntType() ||
-      Ty->isExtVectorBoolType())
+  bool IsBitInt = Ty->isBitIntType();
+  bool HasBoolRep = Ty->hasBooleanRepresentation();
+  if (HasBoolRep && !IsBitInt &&
----------------
brunodf-snps wrote:

`BitInt(1)` does get range metadata today, yes: https://godbolt.org/z/YPjeP8nzx

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


More information about the cfe-commits mailing list