diff options
Diffstat (limited to 'absl/base/macros.h')
-rw-r--r-- | absl/base/macros.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/absl/base/macros.h b/absl/base/macros.h index 3e085a91..bbf7494f 100644 --- a/absl/base/macros.h +++ b/absl/base/macros.h @@ -103,17 +103,11 @@ ABSL_NAMESPACE_END // aborts the program in release mode (when NDEBUG is defined). The // implementation should abort the program as quickly as possible and ideally it // should not be possible to ignore the abort request. -#if (ABSL_HAVE_BUILTIN(__builtin_trap) && \ - ABSL_HAVE_BUILTIN(__builtin_unreachable)) || \ - (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_INTERNAL_HARDENING_ABORT() \ - do { \ - __builtin_trap(); \ - __builtin_unreachable(); \ +#define ABSL_INTERNAL_HARDENING_ABORT() \ + do { \ + ABSL_INTERNAL_IMMEDIATE_ABORT_IMPL(); \ + ABSL_INTERNAL_UNREACHABLE_IMPL(); \ } while (false) -#else -#define ABSL_INTERNAL_HARDENING_ABORT() abort() -#endif // ABSL_HARDENING_ASSERT() // @@ -144,15 +138,7 @@ ABSL_NAMESPACE_END #define ABSL_INTERNAL_RETHROW do {} while (false) #endif // ABSL_HAVE_EXCEPTIONS -// `ABSL_INTERNAL_UNREACHABLE` is an unreachable statement. A program which -// reaches one has undefined behavior, and the compiler may optimize -// accordingly. -#if defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable) -#define ABSL_INTERNAL_UNREACHABLE __builtin_unreachable() -#elif defined(_MSC_VER) -#define ABSL_INTERNAL_UNREACHABLE __assume(0) -#else -#define ABSL_INTERNAL_UNREACHABLE -#endif +// TODO(b/261916195): Replace ABSL_INTERNAL_UNREACHABLE with ABSL_UNREACHABLE(). +#define ABSL_INTERNAL_UNREACHABLE ABSL_UNREACHABLE() #endif // ABSL_BASE_MACROS_H_ |