[upstream_utils] Upgrade to LLVM 22.1.6 (#8919)

This commit is contained in:
Tyler Veness
2026-05-26 16:25:29 -07:00
committed by GitHub
parent 1392db4529
commit 254ca64106
86 changed files with 3236 additions and 2328 deletions

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Mon, 23 Dec 2024 22:56:29 -0800
Subject: [PATCH 32/33] MathExtras: fix minIntN() and maxIntN() assertions
---
llvm/include/llvm/Support/MathExtras.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index 38b1486c54be5102025192b3b90e86e54ab347c0..3141d443674735f334c5da934f891c113c31d582 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -196,7 +196,7 @@ inline constexpr uint64_t maxUIntN(uint64_t N) {
/// Gets the minimum value for a N-bit signed integer.
inline constexpr int64_t minIntN(int64_t N) {
- assert(N <= 64 && "integer width out of range");
+ assert(N >= 0 && N <= 64 && "integer width out of range");
if (N == 0)
return 0;
@@ -209,7 +209,7 @@ inline constexpr int64_t minIntN(int64_t N) {
/// Gets the maximum value for a N-bit signed integer.
inline constexpr int64_t maxIntN(int64_t N) {
- assert(N <= 64 && "integer width out of range");
+ assert(N >= 0 && N <= 64 && "integer width out of range");
// This relies on two's complement wraparound when N == 64, so we convert to
// int64_t only at the very end to avoid UB.