diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-12-27 12:53:22 -0800 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-01-16 20:57:16 -0800 |
commit | ed1a653bad46752c4c4ceb2ada774dff7cd79e81 (patch) | |
tree | fab0d69a8f5e7eacf71e0bdf3669afd192f0740e | |
parent | 501fb3da3fd60538214218cfbccc1abf45a047c2 (diff) | |
download | qemu-ed1a653bad46752c4c4ceb2ada774dff7cd79e81.zip qemu-ed1a653bad46752c4c4ceb2ada774dff7cd79e81.tar.gz qemu-ed1a653bad46752c4c4ceb2ada774dff7cd79e81.tar.bz2 |
tcg: Constify tcg_op_defs
Now that we're no longer assigning to TCGOpDef.args_ct,
we can make the array constant.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r-- | include/tcg/tcg.h | 2 | ||||
-rw-r--r-- | tcg/tcg-common.c | 2 | ||||
-rw-r--r-- | tcg/tcg.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index e28894c..a4630e4 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -716,7 +716,7 @@ typedef struct TCGOpDef { uint8_t flags; } TCGOpDef; -extern TCGOpDef tcg_op_defs[]; +extern const TCGOpDef tcg_op_defs[]; extern const size_t tcg_op_defs_max; /* diff --git a/tcg/tcg-common.c b/tcg/tcg-common.c index 0f30e5b..e98b3e5 100644 --- a/tcg/tcg-common.c +++ b/tcg/tcg-common.c @@ -26,7 +26,7 @@ #include "tcg/tcg.h" #include "tcg-has.h" -TCGOpDef tcg_op_defs[] = { +const TCGOpDef tcg_op_defs[] = { #define DEF(s, oargs, iargs, cargs, flags) \ { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, #include "tcg/tcg-opc.h" @@ -3364,7 +3364,7 @@ static void process_constraint_sets(void) static const TCGArgConstraint *opcode_args_ct(const TCGOp *op) { - TCGOpDef *def = &tcg_op_defs[op->opc]; + const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGConstraintSetIndex con_set; if (def->nb_iargs + def->nb_oargs == 0) { |