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) {
425 assert(node); assert(-1 <= n && n < _get_irn_intra_arity(node));
427 nn = node->in[n + 1];
428 if (!nn || (nn->op != op_Id)) return nn;
430 return (node->in[n + 1] = skip_Id(nn));
434 * Intern version for libFirm.
436 static INLINE ir_node*
437 _get_irn_inter_n(const ir_node *node, int n) {
438 assert(node); assert(-1 <= n && n < _get_irn_inter_arity(node));
440 /* handle Filter and Block specially */
441 if (_get_irn_op(node) == op_Filter) {
442 assert(node->attr.filter.in_cg);
443 return (node->attr.filter.in_cg[n + 1] = skip_Id(node->attr.filter.in_cg[n + 1]));
444 } else if (_get_irn_op(node) == op_Block && node->attr.block.in_cg) {
445 return (node->attr.block.in_cg[n + 1] = skip_Id(node->attr.block.in_cg[n + 1]));
448 return _get_irn_intra_n(node, n);
452 * Access to the predecessors of a node.
453 * To iterate over the operands iterate from 0 to i < get_irn_arity(),
454 * to iterate including the Block predecessor iterate from i = -1 to
456 * If it is a block, the entry -1 is NULL.
457 * Intern version for libFirm.
459 extern ir_node *(*_get_irn_n)(const ir_node *node, int n);
461 static INLINE int _get_irn_deps(const ir_node *node) {
462 return node->deps ? ARR_LEN(node->deps) : 0;
465 static INLINE ir_node *_get_irn_dep(const ir_node *node, int pos) {
466 assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
467 assert(pos >= 0 && pos < ARR_LEN(node->deps) && "dependency index out of range");
468 return node->deps[pos];
472 _set_irn_dep(ir_node *node, int pos, ir_node *dep) {
475 assert(node->deps && "dependency array node yet allocated. use add_irn_dep()");
476 assert(pos >= 0 && pos < ARR_LEN(node->deps) && "dependency index out of range");
477 old = node->deps[pos];
478 node->deps[pos] = dep;
479 edges_notify_edge_kind(node, pos, dep, old, EDGE_KIND_DEP, get_irn_irg(node));
484 _get_irn_ins_or_deps(const ir_node *irn) {
485 return _get_irn_deps(irn) + _get_irn_arity(irn);
488 static INLINE ir_node *
489 _get_irn_in_or_dep(const ir_node *irn, int pos) {
490 int n_in = get_irn_arity(irn);
491 return pos < n_in ? get_irn_n(irn, pos) : get_irn_dep(irn, pos - n_in);
495 * Gets the mode of a node.
496 * Intern version for libFirm.
498 static INLINE ir_mode *
499 _get_irn_mode(const ir_node *node) {
505 * Sets the mode of a node.
506 * Intern version of libFirm.
509 _set_irn_mode(ir_node *node, ir_mode *mode) {
515 * Gets the visited counter of a node.
516 * Intern version for libFirm.
518 static INLINE unsigned long
519 _get_irn_visited(const ir_node *node) {
521 return node->visited;
525 * Sets the visited counter of a node.
526 * Intern version for libFirm.
529 _set_irn_visited(ir_node *node, unsigned long visited) {
531 node->visited = visited;
535 * Mark a node as visited in a graph.
536 * Intern version for libFirm.
539 _mark_irn_visited(ir_node *node) {
541 node->visited = current_ir_graph->visited;
545 * Returns non-zero if a node of was visited.
546 * Intern version for libFirm.
549 _irn_visited(const ir_node *node) {
551 return (node->visited >= current_ir_graph->visited);
555 * Returns non-zero if a node of was NOT visited.
556 * Intern version for libFirm.
559 _irn_not_visited(const ir_node *node) {
561 return (node->visited < current_ir_graph->visited);
565 * Sets the link of a node.
566 * Intern version of libFirm.
569 _set_irn_link(ir_node *node, void *link) {
571 /* Link field is used for Phi construction and various optimizations
573 assert(get_irg_phase_state(get_irn_irg(node)) != phase_building);
579 * Returns the link of a node.
580 * Intern version of libFirm.
583 _get_irn_link(const ir_node *node) {
584 assert(node && _is_ir_node(node));
589 * Returns whether the node _always_ must be pinned.
590 * I.e., the node is not floating after global cse.
592 * Intern version of libFirm.
594 static INLINE op_pin_state
595 _get_irn_pinned(const ir_node *node) {
597 assert(node && _is_ir_node(node));
599 state = _get_op_pinned(_get_irn_op(node));
601 if (state >= op_pin_state_exc_pinned)
602 return get_opt_fragile_ops() ? node->attr.except.pin_state : op_pin_state_pinned;
606 static INLINE op_pin_state
607 _is_irn_pinned_in_irg(const ir_node *node) {
608 if (get_irg_pinned(get_irn_irg(node)) == op_pin_state_floats)
609 return get_irn_pinned(node);
610 return op_pin_state_pinned;
614 _is_unop(const ir_node *node) {
615 assert(node && _is_ir_node(node));
616 return (node->op->opar == oparity_unary);
620 _is_binop(const ir_node *node) {
621 assert(node && _is_ir_node(node));
622 return (node->op->opar == oparity_binary);
626 _is_Bad(const ir_node *node) {
628 return (_get_irn_op(node) == op_Bad);
632 _is_NoMem(const ir_node *node) {
634 return (_get_irn_op(node) == op_NoMem);
638 _is_Mod(const ir_node *node) {
640 return (_get_irn_op(node) == op_Mod);
644 _is_Div(const ir_node *node) {
646 return (_get_irn_op(node) == op_Div);
650 _is_DivMod(const ir_node *node) {
652 return (_get_irn_op(node) == op_DivMod);
656 _is_Quot(const ir_node *node) {
658 return (_get_irn_op(node) == op_Quot);
662 _is_Start(const ir_node *node) {
664 return (_get_irn_op(node) == op_Start);
668 _is_End(const ir_node *node) {
670 return (_get_irn_op(node) == op_End);
674 _is_Const(const ir_node *node) {
676 return (_get_irn_op(node) == op_Const);
680 _is_CopyB(const ir_node *node) {
682 return (_get_irn_op(node) == op_CopyB);
686 _is_Unknown(const ir_node *node) {
688 return (_get_irn_op(node) == op_Unknown);
692 _is_Return(const ir_node *node) {
694 return (_get_irn_op(node) == op_Return);
698 _is_Call(const ir_node *node) {
700 return (_get_irn_op(node) == op_Call);
704 _is_Sel(const ir_node *node) {
706 return (_get_irn_op(node) == op_Sel);
710 _is_Mux(const ir_node *node) {
713 ir_op *op = _get_irn_op(node);
714 return (op == op_Mux || ((op == op_Psi) && _get_irn_arity(node) == 3));
720 _is_Load(const ir_node *node) {
722 return (_get_irn_op(node) == op_Load);
726 _is_Store(const ir_node *node) {
728 return (_get_irn_op(node) == op_Store);
732 _is_Sync(const ir_node *node) {
734 return (_get_irn_op(node) == op_Sync);
738 _is_Confirm(const ir_node *node) {
740 return (_get_irn_op(node) == op_Confirm);
744 _is_Pin(const ir_node *node) {
746 return (_get_irn_op(node) == op_Pin);
750 _is_SymConst(const ir_node *node) {
752 return (_get_irn_op(node) == op_SymConst);
756 _is_Cond(const ir_node *node) {
758 return (_get_irn_op(node) == op_Cond);
762 _is_Cmp(const ir_node *node) {
764 return (_get_irn_op(node) == op_Cmp);
768 _is_Alloc(const ir_node *node) {
770 return (_get_irn_op(node) == op_Alloc);
774 _is_Jmp(const ir_node *node) {
776 return (_get_irn_op(node) == op_Jmp);
780 _is_Raise(const ir_node *node) {
782 return (_get_irn_op(node) == op_Raise);
786 _is_no_Block(const ir_node *node) {
787 assert(node && _is_ir_node(node));
788 return (_get_irn_op(node) != op_Block);
792 _is_Block(const ir_node *node) {
793 assert(node && _is_ir_node(node));
794 return (_get_irn_op(node) == op_Block);
798 _get_Block_n_cfgpreds(const ir_node *node) {
799 assert(_is_Block(node));
800 return _get_irn_arity(node);
803 static INLINE ir_node *
804 _get_Block_cfgpred(ir_node *node, int pos) {
805 assert(0 <= pos && pos < get_irn_arity(node));
806 assert(_is_Block(node));
807 return _get_irn_n(node, pos);
810 /* Get the predecessor block.
812 * Returns the block corresponding to the predecessor pos.
814 * There are several ambiguities we resolve with this function:
815 * - The direct predecessor can be a Proj, which is not pinned.
816 * We walk from the predecessor to the next pinned node
817 * (skip_Proj) and return the block that node is in.
818 * - If we encounter the Bad node, this function does not return
819 * Start, but the Bad node.
821 static INLINE ir_node *
822 _get_Block_cfgpred_block(ir_node *node, int pos) {
823 ir_node *res = skip_Proj(get_Block_cfgpred(node, pos));
825 res = get_nodes_block(res);
829 static INLINE unsigned long
830 _get_Block_block_visited(const ir_node *node) {
831 assert(node->op == op_Block);
832 return node->attr.block.block_visited;
836 _set_Block_block_visited(ir_node *node, unsigned long visit) {
837 assert(node->op == op_Block);
838 node->attr.block.block_visited = visit;
841 /* For this current_ir_graph must be set. */
843 _mark_Block_block_visited(ir_node *node) {
844 assert(node->op == op_Block);
845 node->attr.block.block_visited = get_irg_block_visited(current_ir_graph);
849 _Block_not_block_visited(const ir_node *node) {
850 assert(node->op == op_Block);
851 return (node->attr.block.block_visited < get_irg_block_visited(current_ir_graph));
855 _Block_block_visited(const ir_node *node) {
856 assert(node->op == op_Block);
857 return (node->attr.block.block_visited >= get_irg_block_visited(current_ir_graph));
860 static INLINE ir_node *
861 _set_Block_dead(ir_node *block) {
862 assert(_get_irn_op(block) == op_Block);
863 block->attr.block.dead = 1;
868 _is_Block_dead(const ir_node *block) {
869 ir_op *op = _get_irn_op(block);
874 assert(op == op_Block);
875 return block->attr.block.dead;
879 static INLINE tarval *_get_Const_tarval(ir_node *node) {
880 assert(_get_irn_op(node) == op_Const);
881 return node->attr.con.tv;
884 static INLINE cnst_classify_t _classify_Const(ir_node *node) {
886 assert(_is_ir_node(node));
888 op = _get_irn_op(node);
891 return classify_tarval(_get_Const_tarval(node));
892 else if(op == op_SymConst)
893 return CNST_SYMCONST;
895 return CNST_NO_CONST;
898 static INLINE int _is_irn_forking(const ir_node *node) {
899 return is_op_forking(_get_irn_op(node));
902 static INLINE ir_type *_get_irn_type(ir_node *node) {
903 return _get_irn_op(node)->ops.get_type(node);
906 static INLINE ir_type *_get_irn_type_attr(ir_node *node) {
907 return _get_irn_op(node)->ops.get_type_attr(node);
910 static INLINE ir_entity *_get_irn_entity_attr(ir_node *node) {
911 return _get_irn_op(node)->ops.get_entity_attr(node);
914 static INLINE int _is_irn_constlike(const ir_node *node) {
915 return is_op_constlike(_get_irn_op(node));
918 static INLINE int _is_irn_always_opt(const ir_node *node) {
919 return is_op_always_opt(_get_irn_op(node));
922 static INLINE int _is_irn_keep(const ir_node *node) {
923 return is_op_keep(_get_irn_op(node));
926 static INLINE int _is_irn_start_block_placed(const ir_node *node) {
927 return is_op_start_block_placed(_get_irn_op(node));
930 static INLINE int _is_irn_machine_op(const ir_node *node) {
931 return is_op_machine(_get_irn_op(node));
934 static INLINE int _is_irn_machine_operand(const ir_node *node) {
935 return is_op_machine_operand(_get_irn_op(node));
938 static INLINE int _is_irn_machine_user(const ir_node *node, unsigned n) {
939 return is_op_machine_user(_get_irn_op(node), n);
942 static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) {
943 assert(_get_irn_op(node) == op_Cond);
944 return node->attr.cond.pred;
947 static INLINE void _set_Cond_jmp_pred(ir_node *node, cond_jmp_predicate pred) {
948 assert(_get_irn_op(node) == op_Cond);
949 node->attr.cond.pred = pred;
952 static INLINE int _get_Psi_n_conds(ir_node *node) {
953 assert(_get_irn_op(node) == op_Psi);
954 return _get_irn_arity(node) >> 1;
957 static INLINE unsigned _get_irn_idx(const ir_node *node) {
958 return node->node_idx;
961 /* this section MUST contain all inline functions */
962 #define is_ir_node(thing) _is_ir_node(thing)
963 #define get_irn_intra_arity(node) _get_irn_intra_arity(node)
964 #define get_irn_inter_arity(node) _get_irn_inter_arity(node)
965 #define get_irn_arity(node) _get_irn_arity(node)
966 #define get_irn_intra_n(node, n) _get_irn_intra_n(node, n)
967 #define get_irn_inter_n(node, n) _get_irn_inter_n(node, n)
968 #define get_irn_n(node, n) _get_irn_n(node, n)
969 #define get_irn_mode(node) _get_irn_mode(node)
970 #define set_irn_mode(node, mode) _set_irn_mode(node, mode)
971 #define get_irn_op(node) _get_irn_op(node)
972 #define set_irn_op(node, op) _set_irn_op(node, op)
973 #define get_irn_opcode(node) _get_irn_opcode(node)
974 #define get_irn_visited(node) _get_irn_visited(node)
975 #define set_irn_visited(node, v) _set_irn_visited(node, v)
976 #define mark_irn_visited(node) _mark_irn_visited(node)
977 #define irn_visited(node) _irn_visited(node)
978 #define irn_not_visited(node) _irn_not_visited(node)
979 #define set_irn_link(node, link) _set_irn_link(node, link)
980 #define get_irn_link(node) _get_irn_link(node)
981 #define get_irn_pinned(node) _get_irn_pinned(node)
982 #define is_irn_pinned_in_irg(node) _is_irn_pinned_in_irg(node)
983 #define is_unop(node) _is_unop(node)
984 #define is_binop(node) _is_binop(node)
985 #define is_Const(node) _is_Const(node)
986 #define is_Unknown(node) _is_Unknown(node)
987 #define is_Return(node) _is_Return(node)
988 #define is_Call(node) _is_Call(node)
989 #define is_Sel(node) _is_Sel(node)
990 #define is_Mux(node) _is_Mux(node)
991 #define is_Load(node) _is_Load(node)
992 #define is_Sync(node) _is_Sync(node)
993 #define is_Confirm(node) _is_Confirm(node)
994 #define is_Pin(node) _is_Pin(node)
995 #define is_SymConst(node) _is_SymConst(node)
996 #define is_Cond(node) _is_Cond(node)
997 #define is_CopyB(node) _is_CopyB(node)
998 #define is_Cmp(node) _is_Cmp(node)
999 #define is_Alloc(node) _is_Alloc(node)
1000 #define is_Jmp(node) _is_Jmp(node)
1001 #define is_Raise(node) _is_Raise(node)
1002 #define is_Bad(node) _is_Bad(node)
1003 #define is_NoMem(node) _is_NoMem(node)
1004 #define is_Start(node) _is_Start(node)
1005 #define is_End(node) _is_End(node)
1006 #define is_Mod(node) _is_Mod(node)
1007 #define is_Div(node) _is_Div(node)
1008 #define is_DivMod(node) _is_DivMod(node)
1009 #define is_Quot(node) _is_Quot(node)
1010 #define is_no_Block(node) _is_no_Block(node)
1011 #define is_Block(node) _is_Block(node)
1012 #define get_Block_n_cfgpreds(node) _get_Block_n_cfgpreds(node)
1013 #define get_Block_cfgpred(node, pos) _get_Block_cfgpred(node, pos)
1014 #define get_Block_cfgpred_block(node, pos) _get_Block_cfgpred_block(node, pos)
1015 #define get_Block_block_visited(node) _get_Block_block_visited(node)
1016 #define set_Block_block_visited(node, visit) _set_Block_block_visited(node, visit)
1017 #define mark_Block_block_visited(node) _mark_Block_block_visited(node)
1018 #define Block_not_block_visited(node) _Block_not_block_visited(node)
1019 #define Block_block_visited(node) _Block_block_visited(node)
1020 #define set_Block_dead(block) _set_Block_dead(block)
1021 #define is_Block_dead(block) _is_Block_dead(block)
1022 #define get_Const_tarval(node) _get_Const_tarval(node)
1023 #define classify_Const(node) _classify_Const(node)
1024 #define is_irn_forking(node) _is_irn_forking(node)
1025 #define get_irn_type(node) _get_irn_type(node)
1026 #define get_irn_type_attr(node) _get_irn_type_attr(node)
1027 #define get_irn_entity_attr(node) _get_irn_entity_attr(node)
1028 #define is_irn_constlike(node) _is_irn_constlike(node)
1029 #define is_irn_always_opt(node) _is_irn_always_opt(node)
1030 #define is_irn_keep(node) _is_irn_keep(node)
1031 #define is_irn_start_block_placed(node) _is_irn_start_block_placed(node)
1032 #define is_irn_machine_op(node) _is_irn_machine_op(node)
1033 #define is_irn_machine_operand(node) _is_irn_machine_operand(node)
1034 #define is_irn_machine_user(node, n) _is_irn_machine_user(node, n)
1035 #define get_Cond_jmp_pred(node) _get_Cond_jmp_pred(node)
1036 #define set_Cond_jmp_pred(node, pred) _set_Cond_jmp_pred(node, pred)
1037 #define get_Psi_n_conds(node) _get_Psi_n_conds(node)
1038 #define get_irn_idx(node) _get_irn_idx(node)
1040 #define get_irn_deps(node) _get_irn_deps(node)
1041 #define set_irn_dep(node, pos, dep) _set_irn_dep(node, pos, dep)
1042 #define get_irn_dep(node, pos) _get_irn_dep(node, pos)
1044 #define get_irn_ins_or_deps(node) _get_irn_ins_or_deps(node)
1045 #define get_irn_in_or_dep(node, pos) _get_irn_in_or_dep(node, pos)
1047 #endif /* _IRNODE_T_H_ */