libFirm
firm_types.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
11 #ifndef FIRM_COMMON_FIRM_TYPES_H
12 #define FIRM_COMMON_FIRM_TYPES_H
13 
14 #include "begin.h"
15 
34 typedef unsigned long ir_visited_t;
36 typedef unsigned long ir_label_t;
37 
40 typedef struct dbg_info dbg_info;
50 typedef const char ident;
53 typedef struct ir_node ir_node;
56 typedef struct ir_op ir_op;
59 typedef struct ir_mode ir_mode;
62 typedef struct ir_edge_t ir_edge_t;
65 typedef struct ir_heights_t ir_heights_t;
68 typedef struct ir_tarval ir_tarval;
71 typedef struct ir_type ir_type;
74 typedef struct ir_graph ir_graph;
77 typedef struct ir_prog ir_prog;
80 typedef struct ir_loop ir_loop;
83 typedef struct ir_entity ir_entity;
86 typedef struct ir_cdep ir_cdep;
93 
97 typedef void irg_walk_func(ir_node *, void *);
98 
106 
124 
125 #ifdef __cplusplus
126 # define ENUM_BITSET(type) \
127  extern "C++" { \
128  static inline type operator ~ (type a) { return (type)~(int)a; } \
129  static inline type operator & (type a, type b) { return (type)((int)a & (int)b); } \
130  static inline type operator &= (type& a, type b) { return a = (type)((int)a & (int)b); } \
131  static inline type operator ^ (type a, type b) { return (type)((int)a ^ (int)b); } \
132  static inline type operator ^= (type& a, type b) { return a = (type)((int)a ^ (int)b); } \
133  static inline type operator | (type a, type b) { return (type)((int)a | (int)b); } \
134  static inline type operator |= (type& a, type b) { return a = (type)((int)a | (int)b); } \
135  }
136 #else
137 
141 # define ENUM_BITSET(type)
142 #endif
143 
144 #ifdef __cplusplus
145 # define ENUM_COUNTABLE(type) \
146  extern "C++" { \
147  static inline type operator ++(type& a) { return a = (type)((int)a + 1); } \
148  static inline type operator --(type& a) { return a = (type)((int)a - 1); } \
149  }
150 #else
151 
155 # define ENUM_COUNTABLE(type)
156 #endif
157 
162 typedef enum ir_relation {
164  ir_relation_equal = 1u << 0,
165  ir_relation_less = 1u << 1,
179 } ir_relation;
180 ENUM_BITSET(ir_relation)
181 
182 
186 typedef enum ir_cons_flags {
187  cons_none = 0,
188  cons_volatile = 1U << 0,
189  cons_unaligned = 1U << 1,
190  cons_floats = 1U << 2,
194 } ir_cons_flags;
195 ENUM_BITSET(ir_cons_flags)
196 
197 
201 typedef enum op_pin_state {
206 } op_pin_state;
207 
212 typedef enum cond_jmp_predicate {
217 
235  mtp_property_pure = 1u << 1,
263  mtp_temporary = 1u << 12,
267 ENUM_BITSET(mtp_additional_properties)
268 
269 
272 typedef struct ir_asm_constraint {
273  int in_pos;
274  int out_pos;
278 
282 typedef enum ir_builtin_kind {
306 
310 typedef enum {
311  volatility_non_volatile,
312  volatility_is_volatile
313 } ir_volatility;
314 
318 typedef enum {
319  align_is_aligned = 0,
320  align_non_aligned,
321 } ir_align;
322 
327 typedef enum float_int_conversion_overflow_style_t {
328  ir_overflow_indefinite,
330  ir_overflow_min_max,
333 } float_int_conversion_overflow_style_t;
334 
335 typedef struct hook_entry hook_entry_t;
336 
337 #include "end.h"
338 
339 #endif
GCC __builtin_ctz(): count trailing zero.
Definition: firm_types.h:291
const char ident
Identifier.
Definition: firm_types.h:50
greater or equal
Definition: firm_types.h:169
byte swap
Definition: firm_types.h:295
ir_builtin_kind
Supported libFirm builtins.
Definition: firm_types.h:282
va_start from <stdarg.h>
Definition: firm_types.h:302
ir_relation
Relations for comparing numbers.
Definition: firm_types.h:162
struct ir_tarval ir_tarval
Target Machine Value.
Definition: firm_types.h:68
A input/output constraint attribute.
Definition: firm_types.h:272
less equal or greater (&#39;not unordered&#39;)
Definition: firm_types.h:171
int out_pos
The output position for this constraint.
Definition: firm_types.h:274
Memory operation can float.
Definition: firm_types.h:190
GCC __builtin_parity(): parity.
Definition: firm_types.h:294
Memory operation is unaligned.
Definition: firm_types.h:189
Memory operation is volatile.
Definition: firm_types.h:188
This method never returns.
Definition: firm_types.h:239
ir_mode * mode
The mode of the constraint.
Definition: firm_types.h:276
This method returns newly allocate memory.
Definition: firm_types.h:249
union ir_initializer_t ir_initializer_t
Initializer (for entities)
Definition: firm_types.h:89
cond_jmp_predicate
A type to express conditional jump predictions.
Definition: firm_types.h:212
in port
Definition: firm_types.h:296
unordered, less or equal
Definition: firm_types.h:174
struct ir_edge_t ir_edge_t
Dynamic Reverse Edge.
Definition: firm_types.h:62
All method invocations are known and inside the current compilation unit, the backend can freely choo...
Definition: firm_types.h:255
Nodes of this opcode can be placed in any basic block.
Definition: firm_types.h:202
struct ir_cdep ir_cdep
Control Dependence Analysis Results.
Definition: firm_types.h:86
The function is guaranteed not to end in an endless and to not abort the program. ...
Definition: firm_types.h:242
void irg_walk_func(ir_node *, void *)
type for graph-walk callbacks
Definition: firm_types.h:97
struct type_dbg_info type_dbg_info
Source Type Reference.
Definition: firm_types.h:43
struct ir_loop ir_loop
Loop.
Definition: firm_types.h:80
Try to always inline this function, even if it seems nonprofitable.
Definition: firm_types.h:257
GCC __builtin_trap(): insert trap.
Definition: firm_types.h:283
unordered or less
Definition: firm_types.h:173
always true
Definition: firm_types.h:178
GCC __builtin_frame_address()
Definition: firm_types.h:286
mtp_additional_properties
Additional method type properties: Tell about special properties of a method type.
Definition: firm_types.h:224
The False case is predicted.
Definition: firm_types.h:215
MS __debugbreak(): insert debug break.
Definition: firm_types.h:284
struct ir_type ir_type
Type.
Definition: firm_types.h:71
No jump prediction.
Definition: firm_types.h:213
ir_cons_flags
constrained flags for memory operations.
Definition: firm_types.h:186
This method cannot throw an exception.
Definition: firm_types.h:244
This method can return more than once (typically setjmp).
Definition: firm_types.h:252
GCC __builtin_clz(): count leading zero.
Definition: firm_types.h:290
fragile op throws exception (and produces X_regular and X_except values)
Definition: firm_types.h:191
The behaviour of the method does not depend on any global/external state.
Definition: firm_types.h:235
GCC __builtin_prefetch()
Definition: firm_types.h:287
int in_pos
The input position for this constraint.
Definition: firm_types.h:273
unordered, greater or equal
Definition: firm_types.h:176
No additional properties.
Definition: firm_types.h:226
The True case is predicted.
Definition: firm_types.h:214
marker used for oo analyses needing info whether method is constructor or not
Definition: firm_types.h:265
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
Nodes must remain in this basic block.
Definition: firm_types.h:203
GCC __builtin_ffs(): find first (least) significant 1 bit.
Definition: firm_types.h:288
ident * constraint
The constraint for this input/output.
Definition: firm_types.h:275
GCC __builtin_return_address()
Definition: firm_types.h:285
always false
Definition: firm_types.h:163
less or greater (&#39;not equal&#39; for integer numbers)
Definition: firm_types.h:170
Node must remain in this basic block if it can throw an exception, else can float.
Definition: firm_types.h:204
saturating increment
Definition: firm_types.h:298
struct ir_machine_triple_t ir_machine_triple_t
Machine triple.
Definition: firm_types.h:92
struct ir_prog ir_prog
Program.
Definition: firm_types.h:77
GCC __builtin_popcount(): population count.
Definition: firm_types.h:292
The function should not be inlined.
Definition: firm_types.h:259
struct ir_heights_t ir_heights_t
Computed graph Heights.
Definition: firm_types.h:65
out port
Definition: firm_types.h:297
This method is naked.
Definition: firm_types.h:246
This method does not change any memory known to the rest of the program.
Definition: firm_types.h:229
unordered or greater
Definition: firm_types.h:175
struct ir_entity ir_entity
Entity.
Definition: firm_types.h:83
struct ir_op ir_op
Node Opcode.
Definition: firm_types.h:56
replaced by 0 if args cannot alias, 1 otherwise
Definition: firm_types.h:300
unordered or equal
Definition: firm_types.h:172
The programmer recommends to inline the function.
Definition: firm_types.h:261
Marker used by opt_funccall (really a hack)...
Definition: firm_types.h:263
va_arg from <stdarg.h>
Definition: firm_types.h:303
No constrains.
Definition: firm_types.h:187
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
op_pin_state
pinned states.
Definition: firm_types.h:201
unordered, less or greater (&#39;not equal&#39; for floatingpoint numbers)
Definition: firm_types.h:177
struct dbg_info dbg_info
Source Reference.
Definition: firm_types.h:40
ir_node * uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos)
This function is called, whenever a local variable is used before definition.
Definition: firm_types.h:123
struct ir_switch_table ir_switch_table
A switch table mapping integer numbers to proj-numbers of a Switch-node.
Definition: firm_types.h:105
less or equal
Definition: firm_types.h:168
compare exchange (aka.
Definition: firm_types.h:299