[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/68] tcg: Constify tcg_op_defs
From: |
Richard Henderson |
Subject: |
[PULL 38/68] tcg: Constify tcg_op_defs |
Date: |
Fri, 17 Jan 2025 10:24:26 -0800 |
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>
---
include/tcg/tcg.h | 2 +-
tcg/tcg-common.c | 2 +-
tcg/tcg.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index e28894c57b..a4630e44bc 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 0f30e5b3ec..e98b3e5fdd 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"
diff --git a/tcg/tcg.c b/tcg/tcg.c
index df7c4dab88..32975fe298 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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) {
--
2.43.0
- [PULL 30/68] tcg/tci: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', (continued)
- [PULL 30/68] tcg/tci: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 27/68] tcg/riscv: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 31/68] tcg: Include 'tcg-target-has.h' once in 'tcg-has.h', Richard Henderson, 2025/01/17
- [PULL 32/68] tcg: Only include 'tcg-has.h' when necessary, Richard Henderson, 2025/01/17
- [PULL 35/68] tcg: Change have_vec to has_type in tcg_op_supported, Richard Henderson, 2025/01/17
- [PULL 37/68] tcg: Remove args_ct from TCGOpDef, Richard Henderson, 2025/01/17
- [PULL 28/68] tcg/s390x: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 29/68] tcg/sparc64: Extract TCG_TARGET_HAS_foo defs to 'tcg-target-has.h', Richard Henderson, 2025/01/17
- [PULL 34/68] tcg: Use C_NotImplemented in tcg_target_op_def, Richard Henderson, 2025/01/17
- [PULL 33/68] tcg: Split out tcg-target-mo.h, Richard Henderson, 2025/01/17
- [PULL 38/68] tcg: Constify tcg_op_defs,
Richard Henderson <=
- [PULL 36/68] tcg: Reorg process_op_defs, Richard Henderson, 2025/01/17
- [PULL 39/68] tcg: Validate op supported in opcode_args_ct, Richard Henderson, 2025/01/17
- [PULL 41/68] tcg: Pass type and flags to tcg_target_op_def, Richard Henderson, 2025/01/17
- [PULL 40/68] tcg: Add TCG_OPF_NOT_PRESENT to opcodes without inputs or outputs, Richard Henderson, 2025/01/17
- [PULL 42/68] tcg: Add TCGType argument to tcg_out_op, Richard Henderson, 2025/01/17
- [PULL 43/68] tcg: Remove TCG_OPF_64BIT, Richard Henderson, 2025/01/17
- [PULL 45/68] tcg: Replace IMPLVEC with TCG_OPF_VECTOR, Richard Henderson, 2025/01/17
- [PULL 48/68] tcg/i386: Fold the ext{8, 16, 32}[us] cases into {s}extract, Richard Henderson, 2025/01/17
- [PULL 44/68] tcg: Drop implementation checks from tcg-opc.h, Richard Henderson, 2025/01/17
- [PULL 46/68] tcg/mips: Expand bswap unconditionally, Richard Henderson, 2025/01/17