[llvm] be68a88 - [ADT] Fix non-assertion build after 36c812f771 (#210511)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 18 08:17:44 PDT 2026
Author: Krzysztof Parzyszek
Date: 2026-07-18T10:17:39-05:00
New Revision: be68a8829d6d6a2186f962b37d83984961cedeb1
URL: https://github.com/llvm/llvm-project/commit/be68a8829d6d6a2186f962b37d83984961cedeb1
DIFF: https://github.com/llvm/llvm-project/commit/be68a8829d6d6a2186f962b37d83984961cedeb1.diff
LOG: [ADT] Fix non-assertion build after 36c812f771 (#210511)
E.g. https://lab.llvm.org/buildbot/#/builders/228/builds/5253
Added:
Modified:
llvm/include/llvm/ADT/Sequence.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index b79c794526a8e..a03f0bb6ac9de 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -87,7 +87,8 @@
// std::enable_if
#include "llvm/ADT/STLForwardCompat.h" // llvm::to_underlying
-#include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
+#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;
};
More information about the llvm-commits
mailing list