提交 8d8fdbae 编写于 作者: A Aurelien Jarno 提交者: Peter Maydell

tcg: check for CONFIG_DEBUG_TCG instead of NDEBUG

Check for CONFIG_DEBUG_TCG instead of NDEBUG, drop now useless code.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
Message-id: 1461228530-14852-2-git-send-email-aurelien@aurel32.net
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 eabb7b91
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
makes things much cleaner. */ makes things much cleaner. */
QEMU_BUILD_BUG_ON(TCG_TYPE_I32 != 0 || TCG_TYPE_I64 != 1); QEMU_BUILD_BUG_ON(TCG_TYPE_I32 != 0 || TCG_TYPE_I64 != 1);
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%x0", "%x1", "%x2", "%x3", "%x4", "%x5", "%x6", "%x7", "%x0", "%x1", "%x2", "%x3", "%x4", "%x5", "%x6", "%x7",
"%x8", "%x9", "%x10", "%x11", "%x12", "%x13", "%x14", "%x15", "%x8", "%x9", "%x10", "%x11", "%x12", "%x13", "%x14", "%x15",
"%x16", "%x17", "%x18", "%x19", "%x20", "%x21", "%x22", "%x23", "%x16", "%x17", "%x18", "%x19", "%x20", "%x21", "%x22", "%x23",
"%x24", "%x25", "%x26", "%x27", "%x28", "%fp", "%x30", "%sp", "%x24", "%x25", "%x26", "%x27", "%x28", "%fp", "%x30", "%sp",
}; };
#endif /* NDEBUG */ #endif /* CONFIG_DEBUG_TCG */
static const int tcg_target_reg_alloc_order[] = { static const int tcg_target_reg_alloc_order[] = {
TCG_REG_X20, TCG_REG_X21, TCG_REG_X22, TCG_REG_X23, TCG_REG_X20, TCG_REG_X21, TCG_REG_X22, TCG_REG_X23,
......
...@@ -67,7 +67,7 @@ bool use_idiv_instructions; ...@@ -67,7 +67,7 @@ bool use_idiv_instructions;
# define USING_SOFTMMU 0 # define USING_SOFTMMU 0
#endif #endif
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r0", "%r0",
"%r1", "%r1",
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "tcg-be-ldst.h" #include "tcg-be-ldst.h"
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
#if TCG_TARGET_REG_BITS == 64 #if TCG_TARGET_REG_BITS == 64
"%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi", "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* Register definitions * Register definitions
*/ */
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define LO_OFF (MIPS_BE * 4) #define LO_OFF (MIPS_BE * 4)
#define HI_OFF (4 - LO_OFF) #define HI_OFF (4 - LO_OFF)
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"zero", "zero",
"at", "at",
......
...@@ -89,7 +89,7 @@ static bool have_isa_2_06; ...@@ -89,7 +89,7 @@ static bool have_isa_2_06;
#define TCG_GUEST_BASE_REG 30 #define TCG_GUEST_BASE_REG 30
#endif #endif
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r0", "r0",
"r1", "r1",
......
...@@ -221,7 +221,7 @@ typedef enum S390Opcode { ...@@ -221,7 +221,7 @@ typedef enum S390Opcode {
RX_STH = 0x40, RX_STH = 0x40,
} S390Opcode; } S390Opcode;
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7",
"%r8", "%r9", "%r10" "%r11" "%r12" "%r13" "%r14" "%r15" "%r8", "%r9", "%r10" "%r11" "%r12" "%r13" "%r14" "%r15"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "tcg-be-null.h" #include "tcg-be-null.h"
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%g0", "%g0",
"%g1", "%g1",
......
...@@ -31,11 +31,6 @@ ...@@ -31,11 +31,6 @@
/* Define to jump the ELF file used to communicate with GDB. */ /* Define to jump the ELF file used to communicate with GDB. */
#undef DEBUG_JIT #undef DEBUG_JIT
#if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
/* define it to suppress various consistency checks (faster) */
#define NDEBUG
#endif
#include "qemu/cutils.h" #include "qemu/cutils.h"
#include "qemu/host-utils.h" #include "qemu/host-utils.h"
#include "qemu/timer.h" #include "qemu/timer.h"
...@@ -1586,7 +1581,7 @@ static void tcg_liveness_analysis(TCGContext *s) ...@@ -1586,7 +1581,7 @@ static void tcg_liveness_analysis(TCGContext *s)
} }
#endif #endif
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static void dump_regs(TCGContext *s) static void dump_regs(TCGContext *s)
{ {
TCGTemp *ts; TCGTemp *ts;
...@@ -2454,7 +2449,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb) ...@@ -2454,7 +2449,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
tcg_reg_alloc_op(s, def, opc, args, dead_args, sync_args); tcg_reg_alloc_op(s, def, opc, args, dead_args, sync_args);
break; break;
} }
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
check_regs(s); check_regs(s);
#endif #endif
/* Test for (pending) buffer overflow. The assumption is that any /* Test for (pending) buffer overflow. The assumption is that any
......
...@@ -315,7 +315,7 @@ static const int tcg_target_call_oarg_regs[] = { ...@@ -315,7 +315,7 @@ static const int tcg_target_call_oarg_regs[] = {
#endif #endif
}; };
#ifndef NDEBUG #ifdef CONFIG_DEBUG_TCG
static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { static const char *const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r00", "r00",
"r01", "r01",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册