mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
bulk: Call in place single use cpu_env()
Avoid CPUArchState local variable when cpu_env() is used once. Mechanical patch using the following Coccinelle spatch script: @@ type CPUArchState; identifier env; expression cs; @@ { - CPUArchState *env = cpu_env(cs); ... when != env - env + cpu_env(cs) ... when != env } Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20240129164514.73104-5-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
97e0310601
commit
94956d7b51
9 changed files with 16 additions and 31 deletions
|
@ -282,10 +282,9 @@ static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr)
|
|||
|
||||
static void loongarch_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
|
||||
{
|
||||
CPULoongArchState *env = cpu_env(cs);
|
||||
DisasContext *ctx = container_of(dcbase, DisasContext, base);
|
||||
|
||||
ctx->opcode = translator_ldl(env, &ctx->base, ctx->base.pc_next);
|
||||
ctx->opcode = translator_ldl(cpu_env(cs), &ctx->base, ctx->base.pc_next);
|
||||
|
||||
if (!decode(ctx, ctx->opcode)) {
|
||||
qemu_log_mask(LOG_UNIMP, "Error: unknown opcode. "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue