From a876432997697a81b54f42fb6ed500a53d690570 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Wed, 11 May 2005 13:24:17 +0000 Subject: [PATCH] Some bug bug fixes [r5809] --- ir/ir/irreflect.c | 7 +++++-- ir/ir/irreflect.h | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ir/ir/irreflect.c b/ir/ir/irreflect.c index 72ae101b7..075430be9 100644 --- a/ir/ir/irreflect.c +++ b/ir/ir/irreflect.c @@ -92,7 +92,10 @@ static INLINE void assure_opcode_capacity(int opcode) } +#if 0 #define OPCODES_COUNT (sizeof(opcodes) / sizeof(opcodes[0])) +#endif +#define OPCODES_COUNT opcodes_size rflct_mode_class_t rflct_get_mode_class(const ir_mode *mode) { @@ -171,7 +174,7 @@ const rflct_arg_t *rflct_get_out_args(opcode opc, int sig) { return GET_ARGS(opc, sig); } -int rflct_signature_match(ir_node *irn, int sig) { +int rflct_signature_match(const ir_node *irn, int sig) { opcode op = get_irn_opcode(irn); const rflct_arg_t *args = rflct_get_in_args(op, sig); int dst = 0; @@ -196,7 +199,7 @@ int rflct_signature_match(ir_node *irn, int sig) { return dst; } -int rflct_get_signature(ir_node *irn) { +int rflct_get_signature(const ir_node *irn) { const rflct_opcode_t *opc = GET_OPCODE(get_irn_opcode(irn)); int min_dist = INT_MAX; int min_sig = INT_MAX; diff --git a/ir/ir/irreflect.h b/ir/ir/irreflect.h index 0cc29954b..2f15ace1c 100644 --- a/ir/ir/irreflect.h +++ b/ir/ir/irreflect.h @@ -93,7 +93,7 @@ int rflct_get_signature_count(opcode opc); * @param irn The node. * @return The first matching signature or -1, if no signature matches. */ -int rflct_get_signature(ir_node *irn); +int rflct_get_signature(const ir_node *irn); /** * Get the number of in arguments. @@ -113,6 +113,9 @@ int rflct_get_in_args_count(opcode opc, int sig); */ int rflct_get_out_args_count(opcode opc, int sig); +#define rflct_get_args_count(opc, sig, use) \ + ((use) ? rflct_get_in_args_count(opc, sig) : rflct_get_out_args_count(opc, sig)) + /** * Get the array of use args. * The array is terminated with an entry for which @@ -135,6 +138,9 @@ const rflct_arg_t *rflct_get_in_args(opcode opc, int sig); */ const rflct_arg_t *rflct_get_out_args(opcode opc, int sig); +#define rflct_get_args(opc, sig, use) \ + ((use) ? rflct_get_in_args(opc, sig) : rflct_get_out_args(opc, sig)) + /** * Make a string representation of a signature of an opcode. * @param buf The buffer to put the string to. -- 2.20.1