diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2022-12-18 22:18:31 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-01-05 11:41:29 -0800 |
commit | d44789434bbf51bb4d4a3402066d281fa0efc88c (patch) | |
tree | 36cdaedb9962bae66856e007f5d54320808fe517 /accel | |
parent | f266bec890ead3864f1f5f9805112e0fd19c5066 (diff) | |
download | qemu-d44789434bbf51bb4d4a3402066d281fa0efc88c.zip qemu-d44789434bbf51bb4d4a3402066d281fa0efc88c.tar.gz qemu-d44789434bbf51bb4d4a3402066d281fa0efc88c.tar.bz2 |
tcg: Pass number of arguments to tcg_emit_op() / tcg_op_insert_*()
In order to have variable size allocated TCGOp, pass the number
of arguments we use (and would allocate) up to tcg_op_alloc().
This alters tcg_emit_op(), tcg_op_insert_before() and
tcg_op_insert_after() prototypes.
In tcg_op_alloc() ensure the number of arguments is in range.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
[PMD: Extracted from bigger patch]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221218211832.73312-2-philmd@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/tcg/plugin-gen.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index a6aaacd..62e775d 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -258,10 +258,13 @@ static TCGOp *rm_ops(TCGOp *op) static TCGOp *copy_op_nocheck(TCGOp **begin_op, TCGOp *op) { + unsigned nargs = ARRAY_SIZE(op->args); + *begin_op = QTAILQ_NEXT(*begin_op, link); tcg_debug_assert(*begin_op); - op = tcg_op_insert_after(tcg_ctx, op, (*begin_op)->opc); + op = tcg_op_insert_after(tcg_ctx, op, (*begin_op)->opc, nargs); memcpy(op->args, (*begin_op)->args, sizeof(op->args)); + return op; } |