tcg_op_defs was already a global array.

The tci disassembler also needs ARRAY_SIZE(tcg_op_defs),
so add a new global constant with this value.

Signed-off-by: Stefan Weil <s...@weilnetz.de>
---
 tcg/tcg.c |    1 +
 tcg/tcg.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tcg/tcg.c b/tcg/tcg.c
index fefce5f..15a1f5e 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -89,6 +89,7 @@ TCGOpDef tcg_op_defs[] = {
 #include "tcg-opc.h"
 #undef DEF
 };
+const size_t tcg_op_defs_max = ARRAY_SIZE(tcg_op_defs);
 
 static TCGRegSet tcg_target_available_regs[2];
 static TCGRegSet tcg_target_call_clobber_regs;
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 811e312..79ea3cb 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -525,6 +525,7 @@ typedef struct TCGOpDef {
 } TCGOpDef;
 
 extern TCGOpDef tcg_op_defs[];
+extern const size_t tcg_op_defs_max;
 
 typedef struct TCGTargetOpDef {
     TCGOpcode op;
-- 
1.7.2.5


Reply via email to