[llvm] [ADT] Fix non-assertion build after 36c812f771 (PR #210511)
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 18 06:48:10 PDT 2026
https://github.com/kparzysz updated https://github.com/llvm/llvm-project/pull/210511
>From 303ca9ff3390ec93a1142e315b52132d751f571d Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Sat, 18 Jul 2026 08:43:56 -0500
Subject: [PATCH 1/2] [ADT] Fix non-assertion build after 36c812f771
https://lab.llvm.org/buildbot/#/builders/228/builds/5253
---
llvm/include/llvm/ADT/Sequence.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index b79c794526a8e..6aea8d9e29a91 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -87,6 +87,7 @@
// std::enable_if
#include "llvm/ADT/STLForwardCompat.h" // llvm::to_underlying
+#include "llvm/Support/Error.h" // llvm_unreachable
#include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
namespace llvm {
@@ -185,9 +186,13 @@ struct CheckedInt {
}
private:
+#ifndef NDEBUG
[[noreturn]] static void assertOutOfBounds() {
- assert(false && "Out of bounds");
+ llvm_unreachable("Out of bounds");
}
+#else
+ static constexpr void assertOutOfBounds() {}
+#endif
intmax_t Value = 0;
};
>From 2b90a32c7f9d49a3faa1045e6fb228145a37617f Mon Sep 17 00:00:00 2001
From: Krzysztof Parzyszek <Krzysztof.Parzyszek at amd.com>
Date: Sat, 18 Jul 2026 08:47:55 -0500
Subject: [PATCH 2/2] format
---
llvm/include/llvm/ADT/Sequence.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index 6aea8d9e29a91..a03f0bb6ac9de 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -87,8 +87,8 @@
// std::enable_if
#include "llvm/ADT/STLForwardCompat.h" // llvm::to_underlying
-#include "llvm/Support/Error.h" // llvm_unreachable
-#include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
+#include "llvm/Support/Error.h" // llvm_unreachable
+#include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
namespace llvm {
More information about the llvm-commits
mailing list