From c821ffd98951eee26930d91b82b5349130446bd6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 19 Feb 2018 11:39:01 -0500 Subject: [PATCH] tcg: Change temp_save argument to TCGTemp Backports commit b13eb728d33deaa53efc0dcef557da998e6ec40e from qemu --- qemu/tcg/tcg.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/qemu/tcg/tcg.c b/qemu/tcg/tcg.c index 37329682..8364c9fd 100644 --- a/qemu/tcg/tcg.c +++ b/qemu/tcg/tcg.c @@ -1818,10 +1818,9 @@ static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs) /* save a temporary to memory. 'allocated_regs' is used in case a temporary registers needs to be allocated to store a constant. */ -static inline void temp_save(TCGContext *s, int temp, TCGRegSet allocated_regs) +static inline void temp_save(TCGContext *s, TCGTemp *ts, + TCGRegSet allocated_regs) { - TCGTemp *ts = &s->temps[temp]; - #ifdef USE_LIVENESS_ANALYSIS /* The liveness analysis already ensures that globals are back in memory. Keep an assert for safety. */ @@ -1839,8 +1838,8 @@ static void save_globals(TCGContext *s, TCGRegSet allocated_regs) { int i; - for(i = 0; i < s->nb_globals; i++) { - temp_save(s, i, allocated_regs); + for (i = 0; i < s->nb_globals; i++) { + temp_save(s, &s->temps[i], allocated_regs); } } @@ -1867,13 +1866,12 @@ static void sync_globals(TCGContext *s, TCGRegSet allocated_regs) all globals are stored at their canonical location. */ static void tcg_reg_alloc_bb_end(TCGContext *s, TCGRegSet allocated_regs) { - TCGTemp *ts; int i; - for(i = s->nb_globals; i < s->nb_temps; i++) { - ts = &s->temps[i]; + for (i = s->nb_globals; i < s->nb_temps; i++) { + TCGTemp *ts = &s->temps[i]; if (ts->temp_local) { - temp_save(s, i, allocated_regs); + temp_save(s, ts, allocated_regs); } else { #ifdef USE_LIVENESS_ANALYSIS /* The liveness analysis already ensures that temps are dead.