[clang] [Clang][OpenMP] Fix crash on `_BitInt` loop bounds and counters in loop analysis (PR #226464)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 07:31:57 PDT 2026


================
@@ -5969,6 +5640,16 @@ class CaptureVars : public TreeTransform<CaptureVars> {
 };
 } // namespace
 
+/// Like ASTContext::getIntTypeForBitwidth, but falls back to a _BitInt type
+/// when no standard integer type has the requested width.
+static QualType getIntTypeForBitwidthOrBitInt(ASTContext &C, unsigned Bits,
+                                              bool Signed) {
+  QualType Ty = C.getIntTypeForBitwidth(Bits, Signed);
+  if (Ty.isNull())
+    Ty = C.getBitIntType(/*IsUnsigned=*/!Signed, Bits);
----------------
alexey-bataev wrote:

Maybe just narrow bits down to max supported bits with a warning instead?

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


More information about the cfe-commits mailing list