mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 03:04:34 +01:00
Add new __unreachable() builtin
This is one of the few post gcc4.2 builtins that has been implemented by clang: __builtin_unreachable is used to indicate that a specific point in the program cannot be reached, even if the compiler might otherwise think it can. This is useful to improve optimization and eliminates certain warnings. Hinted by: NetBSD Differential Revision: https://reviews.freebsd.org/D2536
This commit is contained in:
parent
60aa2c85fa
commit
732b31de5d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282907
@ -388,6 +388,12 @@
|
||||
#define __alloc_size(x)
|
||||
#endif
|
||||
|
||||
#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6)
|
||||
#define __unreachable() __builtin_unreachable()
|
||||
#else
|
||||
#define __unreachable() do {} while (/*CONSTCOND*/0)
|
||||
#endif
|
||||
|
||||
#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
|
||||
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user