diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2023-03-27 18:02:33 -0700 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2023-05-23 18:54:55 -0700 |
| commit | 427fbf3721da334c1f429d2a5285caa7025139c2 (patch) | |
| tree | a52729d3eac50fcfbe2b803a09569c7a24ed79ab /include/tcg/debug-assert.h | |
| parent | 8dc24ff467c0d6f1166e229b3c297646ba06c19d (diff) | |
| download | focaccia-qemu-427fbf3721da334c1f429d2a5285caa7025139c2.tar.gz focaccia-qemu-427fbf3721da334c1f429d2a5285caa7025139c2.zip | |
tcg: Split out tcg/debug-assert.h
Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/tcg/debug-assert.h')
| -rw-r--r-- | include/tcg/debug-assert.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/tcg/debug-assert.h b/include/tcg/debug-assert.h new file mode 100644 index 0000000000..596765a3d2 --- /dev/null +++ b/include/tcg/debug-assert.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Define tcg_debug_assert + * Copyright (c) 2008 Fabrice Bellard + */ + +#ifndef TCG_DEBUG_ASSERT_H +#define TCG_DEBUG_ASSERT_H + +#if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS +# define tcg_debug_assert(X) do { assert(X); } while (0) +#else +# define tcg_debug_assert(X) \ + do { if (!(X)) { __builtin_unreachable(); } } while (0) +#endif + +#endif |