3 * File name: ir/ir/irnode_t.h
4 * Purpose: Representation of an intermediate operation -- private header.
5 * Author: Martin Trapp, Christian Schaefer
6 * Modified by: Goetz Lindenmaier, Michael Beck
9 * Copyright: (c) 1998-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * Declarations of an ir node.
18 * @author Martin Trapp, Christian Schaefer
23 #include "firm_config.h"
26 #include "irgraph_t.h"
28 #include "firm_common_t.h"
29 #include "irdom_t.h" /* For size of struct dom_info. */
32 #include "iredgekinds.h"
40 #include "irextbb_t.h"
43 /** ir node attributes **/
45 /** Block attributes */
47 /* General attributes */
48 ir_graph *irg; /**< The graph this block belongs to. */
49 unsigned long block_visited; /**< For the walker that walks over all blocks. */
50 /* Attributes private to construction: */
51 unsigned matured:1; /**< If set, all in-nodes of the block are fixed. */
52 unsigned dead:1; /**< If set, the block is dead (and could be replace by a Bad. */
53 ir_node **graph_arr; /**< An array to store all parameters. */
54 /* Attributes holding analyses information */
55 dom_info dom; /**< Datastructure that holds information about dominators.
57 Eventually overlay with graph_arr as only valid
58 in different phases. Eventually inline the whole
60 dom_info pdom; /**< Datastructure that holds information about post-dominators. */
61 ir_node ** in_cg; /**< array with predecessors in
62 * interprocedural_view, if they differ
63 * from intraprocedural predecessors */
64 int *backedge; /**< Field n set to true if pred n is backedge.
65 @@@ @todo Ev. replace by bit field! */
66 int *cg_backedge; /**< Field n set to true if pred n is interprocedural backedge.
67 @@@ @todo Ev. replace by bit field! */
68 ir_extblk *extblk; /**< The extended basic block this block belongs to. */
70 struct list_head succ_head; /**< A list head for all successor edges of a block. */
73 /** Cond attributes. */
75 cond_kind kind; /**< flavor of Cond */
76 long default_proj; /**< only for non-binary Conds: biggest Proj number, i.e. the one used for default. */
77 cond_jmp_predicate pred; /**< only for binary Conds: The jump predication. */
80 /** Const attributes. */
82 tarval *tv; /**< the target value */
83 ir_type *tp; /**< the source type, for analyses. default: type_unknown. */
86 /** SymConst attributes. */
88 symconst_symbol sym; // old tori
90 ir_type *tp; /**< the source type, for analyses. default: type_unknown. */
93 /** Sel attributes. */
95 ir_entity *ent; /**< entity to select */
98 /** Exception attributes. */
100 op_pin_state pin_state; /**< the pin state for operations that might generate a exception:
101 If it's know that no exception will be generated, could be set to
102 op_pin_state_floats. */
103 #if PRECISE_EXC_CONTEXT
104 struct ir_node **frag_arr; /**< For Phi node construction in case of exception */
108 /** Call attributes. */
110 except_attr exc; /**< the exception attribute. MUST be the first one. */
111 ir_type *cld_tp; /**< type of called procedure */
112 ir_entity ** callee_arr; /**< result of callee analysis */
115 /** Alloc attributes. */
117 except_attr exc; /**< the exception attribute. MUST be the first one. */
118 ir_type *type; /**< Type of the allocated object. */
119 where_alloc where; /**< stack, heap or other managed part of memory */
122 /** Free attributes. */
124 ir_type *type; /**< Type of the allocated object. */
125 where_alloc where; /**< stack, heap or other managed part of memory */
128 /** InstOf attributes. */
130 except_attr exc; /**< the exception attribute. MUST be the first one. */
131 ir_type *type; /**< the type of which the object pointer must be */
134 /** Filter attributes. */
136 long proj; /**< contains the result position to project (Proj) */
137 ir_node ** in_cg; /**< array with interprocedural predecessors (Phi) */
138 int *backedge; /**< Field n set to true if pred n is backedge.
139 @todo Ev. replace by bitfield! */
142 /** EndReg/EndExcept attributes. */
147 /** CallBegin attributes. */
149 ir_node * call; /**< Associated Call-operation. */
152 /** Cast attributes. */
154 ir_type *totype; /**< Type of the casted node. */
157 /** Load attributes. */
159 except_attr exc; /**< The exception attribute. MUST be the first one. */
160 ir_mode *load_mode; /**< The mode of this Load operation. */
161 ir_volatility volatility; /**< The volatility of a Load/Store operation. */
164 /** Store attributes. */
166 except_attr exc; /**< the exception attribute. MUST be the first one. */
167 ir_volatility volatility; /**< the volatility of a Store operation */
170 typedef pn_Cmp confirm_attr; /**< Attribute to hold compare operation */
172 /** CopyB attribute. */
174 except_attr exc; /**< The exception attribute. MUST be the first one. */
175 ir_type *data_type; /**< Type of the copied entity. */
178 /** Bound attribute. */
180 except_attr exc; /**< The exception attribute. MUST be the first one. */
183 /** Conv attribute. */
185 char strict; /**< If set, this is a strict Conv that cannot be removed. */
188 /** Some IR-nodes just have one attribute, these are stored here,
189 some have more. Their name is 'irnodename_attr' */
191 block_attr block; /**< For Block: Fields needed to construct it */
192 cond_attr cond; /**< For Cond. */
193 const_attr con; /**< For Const: contains the value of the constant and a type */
194 symconst_attr symc; /**< For SymConst. */
195 sel_attr sel; /**< For Sel. */
196 call_attr call; /**< For Call: pointer to the type of the method to call */
197 callbegin_attr callbegin; /**< For CallBegin */
198 alloc_attr alloc; /**< For Alloc. */
199 free_attr free; /**< For Free. */
200 io_attr instof; /**< For InstOf */
201 cast_attr cast; /**< For Cast. */
202 load_attr load; /**< For Load. */
203 store_attr store; /**< For Store. */
204 int phi0_pos; /**< For Phi. Used to remember the value defined by
205 this Phi node. Needed when the Phi is completed
206 to call get_r_internal_value to find the
207 predecessors. If this attribute is set, the Phi
208 node takes the role of the obsolete Phi0 node,
209 therefore the name. */
210 int *phi_backedge; /**< For Phi after construction.
211 Field n set to true if pred n is backedge.
212 @todo Ev. replace by bitfield! */
213 long proj; /**< For Proj: contains the result position to project */
214 confirm_attr confirm_cmp; /**< For Confirm: compare operation */
215 filter_attr filter; /**< For Filter */
216 end_attr end; /**< For EndReg, EndExcept */
217 except_attr except; /**< For Phi node construction in case of exceptions */
218 copyb_attr copyb; /**< For CopyB operation */
219 bound_attr bound; /**< For Bound operation */
220 conv_attr conv; /**< For Conv operation */
224 * Edge info to put into an irn.
226 typedef struct _irn_edge_kind_info_t {
227 struct list_head outs_head; /**< The list of all outs. */
228 int out_count; /**< Number of outs in the list. */
231 typedef irn_edge_info_t irn_edges_info_t[EDGE_KIND_LAST];
234 * The common structure of an irnode.
235 * If the node has some attributes, they are stored in the attr field.
238 /* ------- Basics of the representation ------- */
239 firm_kind kind; /**< Distinguishes this node from others. */
240 ir_op *op; /**< The Opcode of this node. */
241 ir_mode *mode; /**< The Mode of this node. */
242 struct ir_node **in; /**< The array of predecessors / operands. */
243 unsigned long visited; /**< The visited counter for walks of the graph. */
244 unsigned node_idx; /**< The node index of this node in its graph. */
245 void *link; /**< To attach additional information to the node, e.g.
246 used while construction to link Phi0 nodes and
247 during optimization to link to nodes that
248 shall replace a node. */
249 /* ------- Fields for optimizations / analysis information ------- */
250 struct ir_node **out; /**< @deprecated array of out edges. */
251 struct dbg_info *dbi; /**< A pointer to information for debug support. */
252 /* ------- For debugging ------- */
255 long node_nr; /**< A unique node number for each node to make output
258 /* ------- For analyses -------- */
259 ir_loop *loop; /**< the loop the node is in. Access routines in irloop.h */
260 #ifdef DO_HEAPANALYSIS
261 struct abstval *av; /**< Heapanalysis: The abstract value of this node. */
262 struct section *sec; /**< Heapanalysis: The section of this node. */
264 struct ir_node **deps; /**< Additional dependencies induced by state. */
265 irn_edges_info_t edge_info; /**< Everlasting out edges. */
266 /* ------- Opcode depending fields -------- */
267 attr attr; /**< The set of attributes of this node. Depends on opcode.
268 Must be last field of struct ir_node. */
273 * Returns the array with the ins. The content of the array may not be
275 * Note that this function returns the whole in array including the
276 * block predecessor. So, it is NOT symmetric with set_irn_in().
278 ir_node **get_irn_in (const ir_node *node);
281 /** access attributes directly */
282 const_attr get_irn_const_attr (ir_node *node);
283 long get_irn_proj_attr (ir_node *node);
284 alloc_attr get_irn_alloc_attr (ir_node *node);
285 free_attr get_irn_free_attr (ir_node *node);
286 symconst_attr get_irn_symconst_attr (ir_node *node);
287 ir_type *get_irn_call_attr (ir_node *node);
288 ir_type *get_irn_funccall_attr (ir_node *node);
289 sel_attr get_irn_sel_attr (ir_node *node);
290 int get_irn_phi_attr (ir_node *node);
291 block_attr get_irn_block_attr (ir_node *node);
292 load_attr get_irn_load_attr (ir_node *node);
293 store_attr get_irn_store_attr (ir_node *node);
294 except_attr get_irn_except_attr (ir_node *node);
298 * The amount of additional space for custom data to be allocated upon creating a new node.
300 extern unsigned firm_add_node_size;
303 * Sets the get_type operation for an ir_op_ops.
305 * @param code the opcode for the default operation
306 * @param ops the operations initialized
311 ir_op_ops *firm_set_default_get_type(ir_opcode code, ir_op_ops *ops);
314 * Sets the get_type_attr operation for an ir_op_ops.
316 * @param code the opcode for the default operation
317 * @param ops the operations initialized
322 ir_op_ops *firm_set_default_get_type_attr(ir_opcode code, ir_op_ops *ops);
325 * Sets the get_entity_attr operation for an ir_op_ops.
327 * @param code the opcode for the default operation
328 * @param ops the operations initialized
333 ir_op_ops *firm_set_default_get_entity_attr(ir_opcode code, ir_op_ops *ops);
335 /*-------------------------------------------------------------------*/
336 /* These function are most used in libfirm. Give them as static */
337 /* functions so they can be inlined. */
338 /*-------------------------------------------------------------------*/
341 * Checks whether a pointer points to a ir node.
342 * Intern version for libFirm.
345 _is_ir_node(const void *thing) {
346 return (get_kind(thing) == k_ir_node);
350 * Gets the op of a node.
351 * Intern version for libFirm.
353 static INLINE ir_op *
354 _get_irn_op(const ir_node *node) {
360 _set_irn_op(ir_node *node, ir_op *op) {
365 /** Copies all attributes stored in the old node to the new node.
366 Assumes both have the same opcode and sufficient size. */
368 copy_node_attr(const ir_node *old_node, ir_node *new_node) {
369 ir_op *op = _get_irn_op(old_node);
371 /* must always exist */
372 op->ops.copy_attr(old_node, new_node);
376 * Gets the opcode of a node.
377 * Intern version for libFirm.
379 static INLINE ir_opcode
380 _get_irn_opcode(const ir_node *node) {
381 assert(k_ir_node == get_kind(node));
383 return node->op->code;
387 * Returns the number of predecessors without the block predecessor.
388 * Intern version for libFirm.
391 _get_irn_intra_arity(const ir_node *node) {
393 return ARR_LEN(node->in) - 1;
397 * Returns the number of predecessors without the block predecessor.
398 * Intern version for libFirm.
401 _get_irn_inter_arity(const ir_node *node) {
403 if (_get_irn_op(node) == op_Filter) {
404 assert(node->attr.filter.in_cg);
405 return ARR_LEN(node->attr.filter.in_cg) - 1;
406 } else if (_get_irn_op(node) == op_Block && node->attr.block.in_cg) {
407 return ARR_LEN(node->attr.block.in_cg) - 1;
409 return _get_irn_intra_arity(node);
413 * Returns the number of predecessors without the block predecessor.
414 * Intern version for libFirm.
416 extern int (*_get_irn_arity)(const ir_node *node);
419 * Intern version for libFirm.
421 static INLINE ir_node *
422 _get_irn_intra_n(const ir_node *node, int n) {
426 assert(-1 <= n && n < _get_irn_intra_arity(node));
428 nn = node->in[n + 1];
430 if (!nn || (nn->op != op_Id)) return nn;
432 return (node->in[n + 1] = skip_Id(nn));
436 * Intern version for libFirm.
438 static INLINE ir_node*
439 _get_irn_inter_n(const ir_node *node, int n) {
440 assert(node); assert(-1 <= n && n < _get_irn_inter_arity(node));
442 /* handle Filter and Block specially */
443 if (_get_irn_op(node) == op_Filter) {
444 assert(node->attr.filter.in_cg);
445 return (node->attr.filter.in_cg[n + 1] = skip_Id(node->attr.filter.in_cg[n + 1]));
446 } else if (_get_irn_op(node) == op_Block && node->attr.block.in_cg) {
447 return (node->attr.block.in_cg[n + 1] = skip_Id(node->attr.block.in_cg[n + 1]));
450 return _get_irn_intra_n(node, n);
454 * Access to the predecessors of a node.
455 * To iterate over the operands iterate from 0 to i < get_irn_arity(),
456 * to iterate including the Block predecessor iterate from i = -1 to
458 * If it is a block, the entry -1 is NULL.
459 * Intern version for libFirm.
461 extern ir_node *(*_get_irn_n)(const ir_node *node, int n);
463 static INLINE int _get_irn_deps(const ir_node *node) {
464 return node->deps ? ARR_LEN(node->deps) : 0;
467 static INLINE ir_node *_get_irn_dep(const ir_node *node, int pos) {
468 assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
469 assert(pos >= 0 && pos < ARR_LEN(node->deps) && "dependency index out of range");
470 return node->deps[pos];
474 _set_irn_dep(ir_node *node, int pos, ir_node *dep) {
477 assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
478 assert(pos >= 0 && pos < ARR_LEN(node->deps) && "dependency index out of range");
479 old = node->deps[pos];
480 node->deps[pos] = dep;
481 edges_notify_edge_kind(node, pos, dep, old, EDGE_KIND_DEP, get_irn_irg(node));
486 _get_irn_ins_or_deps(const ir_node *irn) {
487 return _get_irn_deps(irn) + _get_irn_arity(irn);
490 static INLINE ir_node *
491 _get_irn_in_or_dep(const ir_node *irn, int pos) {
492 int n_in = get_irn_arity(irn);
493 return pos < n_in ? get_irn_n(irn, pos) : get_irn_dep(irn, pos - n_in);
497 * Gets the mode of a node.
498 * Intern version for libFirm.
500 static INLINE ir_mode *
501 _get_irn_mode(const ir_node *node) {
507 * Sets the mode of a node.
508 * Intern version of libFirm.
511 _set_irn_mode(ir_node *node, ir_mode *mode) {
517 * Gets the visited counter of a node.
518 * Intern version for libFirm.
520 static INLINE unsigned long
521 _get_irn_visited(const ir_node *node) {
523 return node->visited;
527 * Sets the visited counter of a node.
528 * Intern version for libFirm.
531 _set_irn_visited(ir_node *node, unsigned long visited) {
533 node->visited = visited;
537 * Mark a node as visited in a graph.
538 * Intern version for libFirm.
541 _mark_irn_visited(ir_node *node) {
543 node->visited = current_ir_graph->visited;
547 * Returns non-zero if a node of was visited.
548 * Intern version for libFirm.
551 _irn_visited(const ir_node *node) {
553 return (node->visited >= current_ir_graph->visited);
557 * Returns non-zero if a node of was NOT visited.
558 * Intern version for libFirm.
561 _irn_not_visited(const ir_node *node) {
563 return (node->visited < current_ir_graph->visited);
567 * Sets the link of a node.
568 * Intern version of libFirm.
571 _set_irn_link(ir_node *node, void *link) {
573 /* Link field is used for Phi construction and various optimizations
575 assert(get_irg_phase_state(get_irn_irg(node)) != phase_building);
581 * Returns the link of a node.
582 * Intern version of libFirm.
585 _get_irn_link(const ir_node *node) {
586 assert(node && _is_ir_node(node));
591 * Returns whether the node _always_ must be pinned.
592 * I.e., the node is not floating after global cse.
594 * Intern version of libFirm.
596 static INLINE op_pin_state
597 _get_irn_pinned(const ir_node *node) {
599 assert(node && _is_ir_node(node));
601 state = _get_op_pinned(_get_irn_op(node));
603 if (state >= op_pin_state_exc_pinned)
604 return get_opt_fragile_ops() ? node->attr.except.pin_state : op_pin_state_pinned;
608 static INLINE op_pin_state
609 _is_irn_pinned_in_irg(const ir_node *node) {
610 if (get_irg_pinned(get_irn_irg(node)) == op_pin_state_floats)
611 return get_irn_pinned(node);
612 return op_pin_state_pinned;
616 _is_unop(const ir_node *node) {
617 assert(node && _is_ir_node(node));
618 return (node->op->opar == oparity_unary);
622 _is_binop(const ir_node *node) {
623 assert(node && _is_ir_node(node));
624 return (node->op->opar == oparity_binary);
628 _is_Bad(const ir_node *node) {
630 return (_get_irn_op(node) == op_Bad);
634 _is_NoMem(const ir_node *node) {
636 return (_get_irn_op(node) == op_NoMem);
640 _is_Mod(const ir_node *node) {
642 return (_get_irn_op(node) == op_Mod);
646 _is_Div(const ir_node *node) {
648 return (_get_irn_op(node) == op_Div);
652 _is_DivMod(const ir_node *node) {
654 return (_get_irn_op(node) == op_DivMod);
658 _is_Quot(const ir_node *node) {
660 return (_get_irn_op(node) == op_Quot);
664 _is_Start(const ir_node *node) {
666 return (_get_irn_op(node) == op_Start);
670 _is_End(const ir_node *node) {
672 return (_get_irn_op(node) == op_End);
676 _is_Const(const ir_node *node) {
678 return (_get_irn_op(node) == op_Const);
682 _is_CopyB(const ir_node *node) {
684 return (_get_irn_op(node) == op_CopyB);
688 _is_Unknown(const ir_node *node) {
690 return (_get_irn_op(node) == op_Unknown);
694 _is_Return(const ir_node *node) {
696 return (_get_irn_op(node) == op_Return);
700 _is_Call(const ir_node *node) {
702 return (_get_irn_op(node) == op_Call);
706 _is_Sel(const ir_node *node) {
708 return (_get_irn_op(node) == op_Sel);
712 _is_Mux(const ir_node *node) {
715 ir_op *op = _get_irn_op(node);
716 return (op == op_Mux || ((op == op_Psi) && _get_irn_arity(node) == 3));
722 _is_Load(const ir_node *node) {
724 return (_get_irn_op(node) == op_Load);
728 _is_Store(const ir_node *node) {
730 return (_get_irn_op(node) == op_Store);
734 _is_Sync(const ir_node *node) {
736 return (_get_irn_op(node) == op_Sync);
740 _is_Confirm(const ir_node *node) {
742 return (_get_irn_op(node) == op_Confirm);
746 _is_Pin(const ir_node *node) {
748 return (_get_irn_op(node) == op_Pin);
752 _is_SymConst(const ir_node *node) {
754 return (_get_irn_op(node) == op_SymConst);
758 _is_Cond(const ir_node *node) {
760 return (_get_irn_op(node) == op_Cond);
764 _is_Cmp(const ir_node *node) {
766 return (_get_irn_op(node) == op_Cmp);
770 _is_Alloc(const ir_node *node) {
772 return (_get_irn_op(node) == op_Alloc);
776 _is_Jmp(const ir_node *node) {
778 return (_get_irn_op(node) == op_Jmp);
782 _is_Raise(const ir_node *node) {
784 return (_get_irn_op(node) == op_Raise);
788 _is_no_Block(const ir_node *node) {
789 assert(node && _is_ir_node(node));
790 return (_get_irn_op(node) != op_Block);
794 _is_Block(const ir_node *node) {
795 assert(node && _is_ir_node(node));
796 return (_get_irn_op(node) == op_Block);
800 _get_Block_n_cfgpreds(const ir_node *node) {
801 assert(_is_Block(node));
802 return _get_irn_arity(node);
805 static INLINE ir_node *
806 _get_Block_cfgpred(ir_node *node, int pos) {
807 assert(0 <= pos && pos < get_irn_arity(node));
808 assert(_is_Block(node));
809 return _get_irn_n(node, pos);
812 /* Get the predecessor block.
814 * Returns the block corresponding to the predecessor pos.
816 * There are several ambiguities we resolve with this function:
817 * - The direct predecessor can be a Proj, which is not pinned.
818 * We walk from the predecessor to the next pinned node
819 * (skip_Proj) and return the block that node is in.
820 * - If we encounter the Bad node, this function does not return
821 * Start, but the Bad node.
823 static INLINE ir_node *
824 _get_Block_cfgpred_block(ir_node *node, int pos) {
825 ir_node *res = skip_Proj(get_Block_cfgpred(node, pos));
827 res = get_nodes_block(res);
831 static INLINE unsigned long
832 _get_Block_block_visited(const ir_node *node) {
833 assert(node->op == op_Block);
834 return node->attr.block.block_visited;
838 _set_Block_block_visited(ir_node *node, unsigned long visit) {
839 assert(node->op == op_Block);
840 node->attr.block.block_visited = visit;
843 /* For this current_ir_graph must be set. */
845 _mark_Block_block_visited(ir_node *node) {
846 assert(node->op == op_Block);
847 node->attr.block.block_visited = get_irg_block_visited(current_ir_graph);
851 _Block_not_block_visited(const ir_node *node) {
852 assert(node->op == op_Block);
853 return (node->attr.block.block_visited < get_irg_block_visited(current_ir_graph));
857 _Block_block_visited(const ir_node *node) {
858 assert(node->op == op_Block);
859 return (node->attr.block.block_visited >= get_irg_block_visited(current_ir_graph));
862 static INLINE ir_node *
863 _set_Block_dead(ir_node *block) {
864 assert(_get_irn_op(block) == op_Block);
865 block->attr.block.dead = 1;
870 _is_Block_dead(const ir_node *block) {
871 ir_op *op = _get_irn_op(block);
876 assert(op == op_Block);
877 return block->attr.block.dead;
881 static INLINE tarval *_get_Const_tarval(ir_node *node) {
882 assert(_get_irn_op(node) == op_Const);
883 return node->attr.con.tv;
886 static INLINE cnst_classify_t _classify_Const(ir_node *node) {
888 assert(_is_ir_node(node));
890 op = _get_irn_op(node);
893 return classify_tarval(_get_Const_tarval(node));
894 else if(op == op_SymConst)
895 return CNST_SYMCONST;
897 return CNST_NO_CONST;
900 static INLINE int _is_irn_forking(const ir_node *node) {
901 return is_op_forking(_get_irn_op(node));
904 static INLINE ir_type *_get_irn_type(ir_node *node) {
905 return _get_irn_op(node)->ops.get_type(node);
908 static INLINE ir_type *_get_irn_type_attr(ir_node *node) {
909 return _get_irn_op(node)->ops.get_type_attr(node);
912 static INLINE ir_entity *_get_irn_entity_attr(ir_node *node) {
913 return _get_irn_op(node)->ops.get_entity_attr(node);
916 static INLINE int _is_irn_constlike(const ir_node *node) {
917 return is_op_constlike(_get_irn_op(node));
920 static INLINE int _is_irn_always_opt(const ir_node *node) {
921 return is_op_always_opt(_get_irn_op(node));
924 static INLINE int _is_irn_keep(const ir_node *node) {
925 return is_op_keep(_get_irn_op(node));
928 static INLINE int _is_irn_start_block_placed(const ir_node *node) {
929 return is_op_start_block_placed(_get_irn_op(node));
932 static INLINE int _is_irn_machine_op(const ir_node *node) {
933 return is_op_machine(_get_irn_op(node));
936 static INLINE int _is_irn_machine_operand(const ir_node *node) {
937 return is_op_machine_operand(_get_irn_op(node));
940 static INLINE int _is_irn_machine_user(const ir_node *node, unsigned n) {
941 return is_op_machine_user(_get_irn_op(node), n);
944 static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) {
945 assert(_get_irn_op(node) == op_Cond);
946 return node->attr.cond.pred;
949 static INLINE void _set_Cond_jmp_pred(ir_node *node, cond_jmp_predicate pred) {
950 assert(_get_irn_op(node) == op_Cond);
951 node->attr.cond.pred = pred;
954 static INLINE int _get_Psi_n_conds(ir_node *node) {
955 assert(_get_irn_op(node) == op_Psi);
956 return _get_irn_arity(node) >> 1;
959 static INLINE unsigned _get_irn_idx(const ir_node *node) {
960 return node->node_idx;
963 /* this section MUST contain all inline functions */
964 #define is_ir_node(thing) _is_ir_node(thing)
965 #define get_irn_intra_arity(node) _get_irn_intra_arity(node)
966 #define get_irn_inter_arity(node) _get_irn_inter_arity(node)
967 #define get_irn_arity(node) _get_irn_arity(node)
968 #define get_irn_intra_n(node, n) _get_irn_intra_n(node, n)
969 #define get_irn_inter_n(node, n) _get_irn_inter_n(node, n)
970 #define get_irn_n(node, n) _get_irn_n(node, n)
971 #define get_irn_mode(node) _get_irn_mode(node)
972 #define set_irn_mode(node, mode) _set_irn_mode(node, mode)
973 #define get_irn_op(node) _get_irn_op(node)
974 #define set_irn_op(node, op) _set_irn_op(node, op)
975 #define get_irn_opcode(node) _get_irn_opcode(node)
976 #define get_irn_visited(node) _get_irn_visited(node)
977 #define set_irn_visited(node, v) _set_irn_visited(node, v)
978 #define mark_irn_visited(node) _mark_irn_visited(node)
979 #define irn_visited(node) _irn_visited(node)
980 #define irn_not_visited(node) _irn_not_visited(node)
981 #define set_irn_link(node, link) _set_irn_link(node, link)
982 #define get_irn_link(node) _get_irn_link(node)
983 #define get_irn_pinned(node) _get_irn_pinned(node)
984 #define is_irn_pinned_in_irg(node) _is_irn_pinned_in_irg(node)
985 #define is_unop(node) _is_unop(node)
986 #define is_binop(node) _is_binop(node)
987 #define is_Const(node) _is_Const(node)
988 #define is_Unknown(node) _is_Unknown(node)
989 #define is_Return(node) _is_Return(node)
990 #define is_Call(node) _is_Call(node)
991 #define is_Sel(node) _is_Sel(node)
992 #define is_Mux(node) _is_Mux(node)
993 #define is_Load(node) _is_Load(node)
994 #define is_Sync(node) _is_Sync(node)
995 #define is_Confirm(node) _is_Confirm(node)
996 #define is_Pin(node) _is_Pin(node)
997 #define is_SymConst(node) _is_SymConst(node)
998 #define is_Cond(node) _is_Cond(node)
999 #define is_CopyB(node) _is_CopyB(node)
1000 #define is_Cmp(node) _is_Cmp(node)
1001 #define is_Alloc(node) _is_Alloc(node)
1002 #define is_Jmp(node) _is_Jmp(node)
1003 #define is_Raise(node) _is_Raise(node)
1004 #define is_Bad(node) _is_Bad(node)
1005 #define is_NoMem(node) _is_NoMem(node)
1006 #define is_Start(node) _is_Start(node)
1007 #define is_End(node) _is_End(node)
1008 #define is_Mod(node) _is_Mod(node)
1009 #define is_Div(node) _is_Div(node)
1010 #define is_DivMod(node) _is_DivMod(node)
1011 #define is_Quot(node) _is_Quot(node)
1012 #define is_no_Block(node) _is_no_Block(node)
1013 #define is_Block(node) _is_Block(node)
1014 #define get_Block_n_cfgpreds(node) _get_Block_n_cfgpreds(node)
1015 #define get_Block_cfgpred(node, pos) _get_Block_cfgpred(node, pos)
1016 #define get_Block_cfgpred_block(node, pos) _get_Block_cfgpred_block(node, pos)
1017 #define get_Block_block_visited(node) _get_Block_block_visited(node)
1018 #define set_Block_block_visited(node, visit) _set_Block_block_visited(node, visit)
1019 #define mark_Block_block_visited(node) _mark_Block_block_visited(node)
1020 #define Block_not_block_visited(node) _Block_not_block_visited(node)
1021 #define Block_block_visited(node) _Block_block_visited(node)
1022 #define set_Block_dead(block) _set_Block_dead(block)
1023 #define is_Block_dead(block) _is_Block_dead(block)
1024 #define get_Const_tarval(node) _get_Const_tarval(node)
1025 #define classify_Const(node) _classify_Const(node)
1026 #define is_irn_forking(node) _is_irn_forking(node)
1027 #define get_irn_type(node) _get_irn_type(node)
1028 #define get_irn_type_attr(node) _get_irn_type_attr(node)
1029 #define get_irn_entity_attr(node) _get_irn_entity_attr(node)
1030 #define is_irn_constlike(node) _is_irn_constlike(node)
1031 #define is_irn_always_opt(node) _is_irn_always_opt(node)
1032 #define is_irn_keep(node) _is_irn_keep(node)
1033 #define is_irn_start_block_placed(node) _is_irn_start_block_placed(node)
1034 #define is_irn_machine_op(node) _is_irn_machine_op(node)
1035 #define is_irn_machine_operand(node) _is_irn_machine_operand(node)
1036 #define is_irn_machine_user(node, n) _is_irn_machine_user(node, n)
1037 #define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
1038 #define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)
1039 #define get_Psi_n_conds(node) _get_Psi_n_conds(node)
1040 #define get_irn_idx(node) _get_irn_idx(node)
1042 #define get_irn_deps(node) _get_irn_deps(node)
1043 #define set_irn_dep(node, pos, dep) _set_irn_dep(node, pos, dep)
1044 #define get_irn_dep(node, pos) _get_irn_dep(node, pos)
1046 #define get_irn_ins_or_deps(node) _get_irn_ins_or_deps(node)
1047 #define get_irn_in_or_dep(node, pos) _get_irn_in_or_dep(node, pos)
1049 #endif /* _IRNODE_T_H_ */