Small cleanup of gen_intermediate_code(_internal), by Laurent Desnogues.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4891 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/exec-all.h b/exec-all.h
index 9432977..5241abe 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -60,8 +60,8 @@
extern FILE *logfile;
extern int loglevel;
-int gen_intermediate_code(CPUState *env, struct TranslationBlock *tb);
-int gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb);
+void gen_intermediate_code(CPUState *env, struct TranslationBlock *tb);
+void gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb);
void gen_pc_load(CPUState *env, struct TranslationBlock *tb,
unsigned long searched_pc, int pc_pos, void *puc);
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 9bf6163..be905bf 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1970,9 +1970,9 @@
return ret;
}
-static always_inline int gen_intermediate_code_internal (CPUState *env,
- TranslationBlock *tb,
- int search_pc)
+static always_inline void gen_intermediate_code_internal (CPUState *env,
+ TranslationBlock *tb,
+ int search_pc)
{
#if defined ALPHA_DEBUG_DISAS
static int insn_count;
@@ -2086,18 +2086,16 @@
fprintf(logfile, "\n");
}
#endif
-
- return 0;
}
-int gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
CPUAlphaState * cpu_alpha_init (const char *cpu_model)
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 1753213..3183ef8 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -8544,9 +8544,9 @@
/* generate intermediate code in gen_opc_buf and gen_opparam_buf for
basic block 'tb'. If search_pc is TRUE, also generate PC
information for each intermediate instruction. */
-static inline int gen_intermediate_code_internal(CPUState *env,
- TranslationBlock *tb,
- int search_pc)
+static inline void gen_intermediate_code_internal(CPUState *env,
+ TranslationBlock *tb,
+ int search_pc)
{
DisasContext dc1, *dc = &dc1;
uint16_t *gen_opc_end;
@@ -8787,17 +8787,16 @@
tb->size = dc->pc - pc_start;
tb->icount = num_insns;
}
- return 0;
}
-int gen_intermediate_code(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
static const char *cpu_mode_names[16] = {
diff --git a/target-cris/translate.c b/target-cris/translate.c
index d971d1d..0c23cdf 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3022,7 +3022,7 @@
*/
/* generate intermediate code for basic block 'tb'. */
-static int
+static void
gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
int search_pc)
{
@@ -3233,17 +3233,16 @@
dc->pc - pc_start, gen_opc_ptr - gen_opc_buf);
}
#endif
- return 0;
}
-int gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void cpu_dump_state (CPUState *env, FILE *f,
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 7dc3171..c4a1195 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -7148,9 +7148,9 @@
/* generate intermediate code in gen_opc_buf and gen_opparam_buf for
basic block 'tb'. If search_pc is TRUE, also generate PC
information for each intermediate instruction. */
-static inline int gen_intermediate_code_internal(CPUState *env,
- TranslationBlock *tb,
- int search_pc)
+static inline void gen_intermediate_code_internal(CPUState *env,
+ TranslationBlock *tb,
+ int search_pc)
{
DisasContext dc1, *dc = &dc1;
target_ulong pc_ptr;
@@ -7321,17 +7321,16 @@
tb->size = pc_ptr - pc_start;
tb->icount = num_insns;
}
- return 0;
}
-int gen_intermediate_code(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void gen_pc_load(CPUState *env, TranslationBlock *tb,
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index e3e56d0..d5872a1 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -2911,7 +2911,7 @@
}
/* generate intermediate code for basic block 'tb'. */
-static inline int
+static inline void
gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
int search_pc)
{
@@ -3039,17 +3039,16 @@
//optimize_flags();
//expand_target_qops();
- return 0;
}
-int gen_intermediate_code(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
+void gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void cpu_dump_state(CPUState *env, FILE *f,
diff --git a/target-mips/translate.c b/target-mips/translate.c
index bdc0f7b..4a2fb24 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -8453,7 +8453,7 @@
}
}
-static inline int
+static inline void
gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
int search_pc)
{
@@ -8598,18 +8598,16 @@
fprintf(logfile, "---------------- %d %08x\n", ctx.bstate, ctx.hflags);
}
#endif
-
- return 0;
}
-int gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void fpu_dump_state(CPUState *env, FILE *f,
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index e0c3185..146ba3a 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -6171,9 +6171,9 @@
}
/*****************************************************************************/
-static always_inline int gen_intermediate_code_internal (CPUState *env,
- TranslationBlock *tb,
- int search_pc)
+static always_inline void gen_intermediate_code_internal (CPUState *env,
+ TranslationBlock *tb,
+ int search_pc)
{
DisasContext ctx, *ctxp = &ctx;
opc_handler_t **table, *handler;
@@ -6379,17 +6379,16 @@
fprintf(logfile, "\n");
}
#endif
- return 0;
}
-int gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
+void gen_intermediate_code_pc (CPUState *env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void gen_pc_load(CPUState *env, TranslationBlock *tb,
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 0a6f417..a73805f 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -1195,7 +1195,7 @@
}
}
-static inline int
+static inline void
gen_intermediate_code_internal(CPUState * env, TranslationBlock * tb,
int search_pc)
{
@@ -1326,17 +1326,16 @@
fprintf(logfile, "\n");
}
#endif
- return 0;
}
-int gen_intermediate_code(CPUState * env, struct TranslationBlock *tb)
+void gen_intermediate_code(CPUState * env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 0);
+ gen_intermediate_code_internal(env, tb, 0);
}
-int gen_intermediate_code_pc(CPUState * env, struct TranslationBlock *tb)
+void gen_intermediate_code_pc(CPUState * env, struct TranslationBlock *tb)
{
- return gen_intermediate_code_internal(env, tb, 1);
+ gen_intermediate_code_internal(env, tb, 1);
}
void gen_pc_load(CPUState *env, TranslationBlock *tb,
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index aac1545..25842b1 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -4724,8 +4724,8 @@
#endif
}
-static inline int gen_intermediate_code_internal(TranslationBlock * tb,
- int spc, CPUSPARCState *env)
+static inline void gen_intermediate_code_internal(TranslationBlock * tb,
+ int spc, CPUSPARCState *env)
{
target_ulong pc_start, last_pc;
uint16_t *gen_opc_end;
@@ -4869,17 +4869,16 @@
fprintf(logfile, "\n");
}
#endif
- return 0;
}
-int gen_intermediate_code(CPUSPARCState * env, TranslationBlock * tb)
+void gen_intermediate_code(CPUSPARCState * env, TranslationBlock * tb)
{
- return gen_intermediate_code_internal(tb, 0, env);
+ gen_intermediate_code_internal(tb, 0, env);
}
-int gen_intermediate_code_pc(CPUSPARCState * env, TranslationBlock * tb)
+void gen_intermediate_code_pc(CPUSPARCState * env, TranslationBlock * tb)
{
- return gen_intermediate_code_internal(tb, 1, env);
+ gen_intermediate_code_internal(tb, 1, env);
}
void gen_intermediate_code_init(CPUSPARCState *env)
diff --git a/translate-all.c b/translate-all.c
index 2636495..1c27fd3 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -94,9 +94,8 @@
#endif
tcg_func_start(s);
- if (gen_intermediate_code(env, tb) < 0)
- return -1;
-
+ gen_intermediate_code(env, tb);
+
/* generate machine code */
gen_code_buf = tb->tc_ptr;
tb->tb_next_offset[0] = 0xffff;
@@ -156,8 +155,7 @@
#endif
tcg_func_start(s);
- if (gen_intermediate_code_pc(env, tb) < 0)
- return -1;
+ gen_intermediate_code_pc(env, tb);
if (use_icount) {
/* Reset the cycle counter to the start of the block. */