[clang] [CIR] Integral types; simple global variables (PR #118743)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 13:26:09 PST 2024


================
@@ -72,9 +63,15 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
   }
   case Type::BitInt: {
     const auto *bitIntTy = cast<BitIntType>(type);
-    resultType =
-        cir::IntType::get(cgm.getBuilder().getContext(), bitIntTy->getNumBits(),
-                          bitIntTy->isSigned());
+    if (bitIntTy->getNumBits() > cir::IntType::maxBitwidth()) {
+      cgm.errorNYI(SourceLocation(), "large _BitInt type", type);
+      resultType = cir::IntType::get(cgm.getBuilder().getContext(), 32,
----------------
erichkeane wrote:

That seems like a reasonable take.  That seems consistent.

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


More information about the cfe-commits mailing list