#include "obst.h"
+#include "irnode_t.h"
#include "irmode.h"
#include "irreflect.h"
} rflct_args_t;
typedef struct {
- opcode opc;
+ ir_opcode opc;
const char *name;
int commutative;
int sig_count;
return RFLCT_MC(None);
}
-static INLINE const rflct_opcode_t *get_opcode(opcode opc) {
+static INLINE const rflct_opcode_t *get_opcode(ir_opcode opc) {
assert(opc >= 0 && opc < OPCODES_COUNT && "Invalid opcode");
return opcodes[opc];
}
-static INLINE const rflct_arg_t *get_args(opcode opc, int sig) {
+static INLINE const rflct_arg_t *get_args(ir_opcode opc, int sig) {
const rflct_opcode_t *opcode = get_opcode(opc);
assert(sig >= 0 && sig < opcode->sig_count
&& "Invalid signature");
#define GET_OPCODE(opc) get_opcode(opc)
#define GET_ARGS(opc,args) get_args(opc, args)
-int rflct_get_signature_count(opcode opc) {
+int rflct_get_signature_count(ir_opcode opc) {
const rflct_opcode_t *opcode = GET_OPCODE(opc);
return opcode->sig_count;
}
-int rflct_get_in_args_count(opcode opc, int sig) {
+int rflct_get_in_args_count(ir_opcode opc, int sig) {
const rflct_arg_t *args = GET_ARGS(opc, sig);
int res = 0, i = 0;
return res;
}
-int rflct_get_out_args_count(opcode opc, int sig) {
+int rflct_get_out_args_count(ir_opcode opc, int sig) {
const rflct_arg_t *args = GET_ARGS(opc, sig);
int i = 0;
for(i = 0; args[i].name != NULL; i++);
}
-const rflct_arg_t *rflct_get_in_args(opcode opc, int sig) {
+const rflct_arg_t *rflct_get_in_args(ir_opcode opc, int sig) {
const rflct_arg_t *args = GET_ARGS(opc, sig);
int i;
return &args[i + 1];
}
-const rflct_arg_t *rflct_get_out_args(opcode opc, int sig) {
+const rflct_arg_t *rflct_get_out_args(ir_opcode opc, int sig) {
return GET_ARGS(opc, sig);
}
int rflct_signature_match(const ir_node *irn, int sig) {
- opcode op = get_irn_opcode(irn);
+ ir_opcode op = get_irn_opcode(irn);
const rflct_arg_t *args = rflct_get_in_args(op, sig);
int dst = 0;
int i, j;
}
-char *rflct_to_string(char *buf, int n, opcode opc, int sig) {
+char *rflct_to_string(char *buf, int n, ir_opcode opc, int sig) {
struct obstack obst;
char *s;
const rflct_opcode_t *opcode = GET_OPCODE(opc);
arg->is_variadic = _var; \
arg->mode_equals = _me;
-void rflct_new_opcode(opcode opc, const char *name, int commutative)
+void rflct_new_opcode(ir_opcode opc, const char *name, int commutative)
{
rflct_opcode_t *ropc = obstack_alloc(&obst, sizeof(*ropc));
opcodes[opc] = ropc;
}
-int rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig)
+int rflct_opcode_add_signature(ir_opcode opc, rflct_sig_t *sig)
{
rflct_arg_t *args = sig->args;
rflct_opcode_t *op = opcodes[opc];