states: fix get_state_expr() uses of fake_parent
[smatch.git] / opcode.h
blobe426bed4f7e269416529ff2033ab1cadf8cc17d3
1 #ifndef OPCODE_H
2 #define OPCODE_H
4 #include "symbol.h"
6 enum opcode {
7 #define OPCODE(OP,NG,SW,TF,N,FL) OP_##OP,
8 #define OPCODE_RANGE(OP,S,E) OP_##OP = OP_##S, OP_##OP##_END = OP_##E,
9 #include "opcode.def"
10 #undef OPCODE
11 #undef OPCODE_RANGE
12 OP_LAST, /* keep this one last! */
15 extern const struct opcode_table {
16 int negate:8;
17 int swap:8;
18 int to_float:8;
19 unsigned int arity:2;
20 unsigned int flags:6;
21 #define OPF_NONE 0
22 #define OPF_TARGET (1 << 0)
23 } opcode_table[];
26 static inline int opcode_float(int opcode, struct symbol *type)
28 if (!type || !is_float_type(type))
29 return opcode;
30 return opcode_table[opcode].to_float;
33 #endif