mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
libcl: add unreachable() macro
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33099>
This commit is contained in:
parent
72bd3a6004
commit
2a1524a089
1 changed files with 9 additions and 0 deletions
|
|
@ -161,6 +161,15 @@ static inline void abort(void) { nir_printf_abort(); }
|
|||
#define assert(x)
|
||||
#endif
|
||||
|
||||
/* This is the unreachable macro from macros.h that uses __builtin_unreachable,
|
||||
* which is a clang builtin available in OpenCL C.
|
||||
*/
|
||||
#define unreachable(str) \
|
||||
do { \
|
||||
assert(!"" str); \
|
||||
__builtin_unreachable(); \
|
||||
} while (0)
|
||||
|
||||
/* Core OpenCL C like likely/unlikely. We might be able to map to a clang built
|
||||
* in though...
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue