Skip to content

Commit

Permalink
tcg: Split out tcg/debug-assert.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rth7680 committed May 24, 2023
1 parent 8dc24ff commit 427fbf3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ F: include/sysemu/tcg.h
F: include/hw/core/tcg-cpu-ops.h
F: host/include/*/host/cpuinfo.h
F: util/cpuinfo-*.c
F: include/tcg/

FPU emulation
M: Aurelien Jarno <aurelien@aurel32.net>
Expand Down
17 changes: 17 additions & 0 deletions include/tcg/debug-assert.h
Original file line number Diff line number Diff line change
@@ -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
9 changes: 1 addition & 8 deletions include/tcg/tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "tcg/tcg-mo.h"
#include "tcg-target.h"
#include "tcg/tcg-cond.h"
#include "tcg/debug-assert.h"

/* XXX: make safe guess about sizes */
#define MAX_OP_PER_INSTR 266
Expand Down Expand Up @@ -222,14 +223,6 @@ typedef uint64_t tcg_insn_unit;
/* The port better have done this. */
#endif


#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

typedef struct TCGRelocation TCGRelocation;
struct TCGRelocation {
QSIMPLEQ_ENTRY(TCGRelocation) next;
Expand Down

0 comments on commit 427fbf3

Please sign in to comment.