From 79ad108fab60159461d4c78ffb97b910d446cc11 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Sun, 4 Aug 2024 21:23:39 -0400 Subject: [PATCH] unreachable --- CMakeLists.txt | 2 +- include/blt/std/utility.h | 8 ++++++++ libraries/parallel-hashmap | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bed19f6..4daa5b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.18.19) +set(BLT_VERSION 0.18.20) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/utility.h b/include/blt/std/utility.h index 2be3245..cf6ab87 100644 --- a/include/blt/std/utility.h +++ b/include/blt/std/utility.h @@ -96,6 +96,7 @@ namespace blt #if defined(__GNUC__) || defined(__llvm__) + #define BLT_UNREACHABLE __builtin_unreachable() #define BLT_ATTRIB_NO_INLINE __attribute__ ((noinline)) /** * means that the return value is solely a function of the arguments, @@ -114,12 +115,19 @@ namespace blt #else #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) #define BLT_ATTRIB_NO_INLINE __declspec(noinline) + #define BLT_UNREACHABLE __assume(false) #else #define BLT_ATTRIB_NO_INLINE + #define BLT_UNREACHABLE #endif #define BLT_ATTRIB_CONST #define BLT_ATTRIB_PURE #endif + +#if __cplusplus > 202002L + #undef BLT_UNREACHABLE + #define BLT_UNREACHABLE std::unreachable() +#endif template BLT_ATTRIB_NO_INLINE void black_box(const T& val) diff --git a/libraries/parallel-hashmap b/libraries/parallel-hashmap index d88c5e1..8a889d3 160000 --- a/libraries/parallel-hashmap +++ b/libraries/parallel-hashmap @@ -1 +1 @@ -Subproject commit d88c5e15079047777b418132ece5879e7c9aaa2b +Subproject commit 8a889d3699b3c09ade435641fb034427f3fd12b6