X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firreflect.h;h=781f4a102274c52d5c2248205cf8b04eda350fc0;hb=e5bab593a4048c0a320d7794fb2cb17697da8389;hp=f8cf44b222b7770dba21992a87a08f39c485db59;hpb=b2cbbfbb63b7d62b58a9523db6121f4672396d9e;p=libfirm diff --git a/ir/ir/irreflect.h b/ir/ir/irreflect.h index f8cf44b22..781f4a102 100644 --- a/ir/ir/irreflect.h +++ b/ir/ir/irreflect.h @@ -4,7 +4,11 @@ * @author Sebastian Hack * @brief Reflection for Firm operations. * +<<<<<<< irreflect.h * $Id$ +======= + * $Id$ +>>>>>>> 1.2 */ #ifndef __REFLECT_H @@ -18,17 +22,17 @@ #define RFLCT_MC(m) rflct_ms_ ## m typedef enum { - RFLCT_MC(None) = 0, - RFLCT_MC(Mem) = 2, - RFLCT_MC(Bool) = 4, - RFLCT_MC(IntS) = 8, - RFLCT_MC(IntU) = 16, + RFLCT_MC(None) = 0, + RFLCT_MC(Mem) = 2, + RFLCT_MC(Bool) = 4, + RFLCT_MC(IntS) = 8, + RFLCT_MC(IntU) = 16, RFLCT_MC(Float) = 32, - RFLCT_MC(Ref) = 64, - RFLCT_MC(Char) = 128, - RFLCT_MC(X) = 256, - RFLCT_MC(BB) = 512, - RFLCT_MC(Cf) = RFLCT_MC(X) | RFLCT_MC(BB), + RFLCT_MC(Ref) = 64, + RFLCT_MC(Char) = 128, + RFLCT_MC(X) = 256, + RFLCT_MC(BB) = 512, + RFLCT_MC(Cf) = RFLCT_MC(X) | RFLCT_MC(BB), RFLCT_MC(Int) = RFLCT_MC(IntS) | RFLCT_MC(IntU), RFLCT_MC(Intb) = RFLCT_MC(Int) | RFLCT_MC(Bool), @@ -62,24 +66,9 @@ typedef struct { must be the same. If false, they can differ. */ } rflct_arg_t; -typedef unsigned int rflct_mode_set_t; - -#define rflct_modeset_contains(mode_set,modecode) \ - (((mode_set) & (1 << modecode)) != 0) - -#define rflct_modeset_issubset(s1,s2) \ - (((s1) & (s2)) == (s1)) - -#define rflct_modeset_union(s1,s2) \ - ((s1) | (s2)) - -#define rflct_modeset_intersect(s1,s2) \ - ((s1) & (s2)) - -#define rflct_modeset_diff(s1,s2) \ - ((s1) & ~(s2)) - +#define RFLCT_ARG_IS_A(arg,modes) (((arg)->accepted_modes & modes) != 0) #define RFLCT_ARG_VALID(arg) ((arg)->name != NULL) +#define RFLCT_SIG_VALID(sig) ((sig) != INT_MAX) /** * Get the mode class for an IR mode. @@ -143,8 +132,23 @@ const rflct_arg_t *rflct_get_in_args(opcode opc, int sig); */ const rflct_arg_t *rflct_get_out_args(opcode opc, int sig); +/** + * Make a string representation of a signature of an opcode. + * @param buf The buffer to put the string to. + * @param n The size of buf. + * @param opc The opcode. + * @param sig The signature. + * @return buf. + */ char *rflct_to_string(char *buf, int n, opcode opc, int sig); +/** + * Get a string representation of a mode class. + * @param str The buffer to put the string to. + * @param n The size of the buffer. + * @param mc The mode class. + * @return str. + */ char *rflct_mode_class_name(char *str, int n, rflct_mode_class_t mc); #endif