[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 24/81] tcg: Constify tcg_op_defs
From: |
Richard Henderson |
Subject: |
[PATCH v2 24/81] tcg: Constify tcg_op_defs |
Date: |
Tue, 7 Jan 2025 00:00:15 -0800 |
Now that we're no longer assigning to TCGOpDef.args_ct,
we can make the array constant.
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 612260a528..1b8bb49aa8 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 234e837e39..f72a8e5a47 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3364,7 +3364,7 @@ static void process_constraint_sets(TCGContext *s)
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
- [PATCH v2 16/81] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc, (continued)
- [PATCH v2 16/81] tcg/tci: Move TCI specific opcodes to tcg-target-opc.h.inc, Richard Henderson, 2025/01/07
- [PATCH v2 09/81] target/tricore: Use tcg_op_supported, Richard Henderson, 2025/01/07
- [PATCH v2 17/81] tcg: Move fallback tcg_can_emit_vec_op out of line, Richard Henderson, 2025/01/07
- [PATCH v2 20/81] tcg: Use C_NotImplemented in tcg_target_op_def, Richard Henderson, 2025/01/07
- [PATCH v2 02/81] tcg: Replace TCGOP_VECL with TCGOP_TYPE, Richard Henderson, 2025/01/07
- [PATCH v2 11/81] target/i386: Remove TCG_TARGET_extract_tl_valid, Richard Henderson, 2025/01/07
- [PATCH v2 21/81] tcg: Change have_vec to has_type in tcg_op_supported, Richard Henderson, 2025/01/07
- [PATCH v2 24/81] tcg: Constify tcg_op_defs,
Richard Henderson <=
- [PATCH v2 26/81] tcg: Add TCG_OPF_NOT_PRESENT to opcodes without inputs or outputs, Richard Henderson, 2025/01/07
- [PATCH v2 25/81] tcg: Validate op supported in opcode_args_ct, Richard Henderson, 2025/01/07
- [PATCH v2 06/81] tcg: Add type and flags arguments to tcg_op_supported, Richard Henderson, 2025/01/07
- [PATCH v2 07/81] target/arm: Do not test TCG_TARGET_HAS_bitsel_vec, Richard Henderson, 2025/01/07