libFirm
Tuple node

Builds a Tuple from single values. More...

Functions

ir_nodenew_rd_Tuple (dbg_info *dbgi, ir_node *block, int arity, ir_node *const *in)
 Construct a Tuple node. More...
 
ir_nodenew_r_Tuple (ir_node *block, int arity, ir_node *const *in)
 Construct a Tuple node. More...
 
ir_nodenew_d_Tuple (dbg_info *dbgi, int arity, ir_node *const *in)
 Construct a Tuple node. More...
 
ir_nodenew_Tuple (int arity, ir_node *const *in)
 Construct a Tuple node. More...
 
int is_Tuple (const ir_node *node)
 Test if node is a Tuple. More...
 
int get_Tuple_n_preds (ir_node const *node)
 Get the number of Tuple preds. More...
 
ir_nodeget_Tuple_pred (ir_node const *node, int pos)
 Get the Tuple pred with index pos. More...
 
void set_Tuple_pred (ir_node *node, int pos, ir_node *pred)
 Set the Tuple pred with index pos. More...
 
ir_node ** get_Tuple_pred_arr (ir_node *node)
 Get an array of all Tuple preds. More...
 
ir_opget_op_Tuple (void)
 Returns opcode for Tuple nodes. More...
 

Variables

ir_opop_Tuple
 Tuple opcode. More...
 

Detailed Description

Builds a Tuple from single values.

This is needed to implement optimizations that remove a node that produced a tuple. The node can be replaced by the Tuple operation so that the following Proj nodes have not to be changed. (They are hard to find due to the implementation with pointers in only one direction.) The Tuple node is smaller than any other node, so that a node can be changed into a Tuple by just changing its opcode and giving it a new in array.

Function Documentation

ir_op* get_op_Tuple ( void  )

Returns opcode for Tuple nodes.

Definition at line 2859 of file gen_irnode.c.

References op_Tuple.

int get_Tuple_n_preds ( ir_node const *  node)

Get the number of Tuple preds.

Definition at line 2839 of file gen_irnode.c.

ir_node* get_Tuple_pred ( ir_node const *  node,
int  pos 
)

Get the Tuple pred with index pos.

Definition at line 2844 of file gen_irnode.c.

ir_node** get_Tuple_pred_arr ( ir_node node)

Get an array of all Tuple preds.

Definition at line 2854 of file gen_irnode.c.

References op_Tuple.

int is_Tuple ( const ir_node node)

Test if node is a Tuple.

Returns
1 if the node is a Tuple node, 0 otherwise

Definition at line 3515 of file gen_irnode.c.

ir_node* new_d_Tuple ( dbg_info dbgi,
int  arity,
ir_node *const *  in 
)

Construct a Tuple node.

Parameters
dbgiA pointer to debug information.
aritysize of additional inputs array
inadditional inputs

Definition at line 2827 of file gen_irnode.c.

References current_ir_graph, get_cur_block(), IR_GRAPH_CONSTRAINT_CONSTRUCTION, irg_is_constrained(), and new_rd_Tuple().

Referenced by new_Tuple().

ir_node* new_r_Tuple ( ir_node block,
int  arity,
ir_node *const *  in 
)

Construct a Tuple node.

Parameters
blockThe IR block the node belongs to.
aritysize of additional inputs array
inadditional inputs

Definition at line 2822 of file gen_irnode.c.

References new_rd_Tuple().

ir_node* new_rd_Tuple ( dbg_info dbgi,
ir_node block,
int  arity,
ir_node *const *  in 
)

Construct a Tuple node.

Parameters
dbgiA pointer to debug information.
blockThe IR block the node belongs to.
aritysize of additional inputs array
inadditional inputs

Definition at line 2808 of file gen_irnode.c.

References get_irn_irg(), mode_T, new_ir_node(), op_Tuple, optimize_node(), and verify_new_node().

Referenced by new_d_Tuple(), and new_r_Tuple().

ir_node* new_Tuple ( int  arity,
ir_node *const *  in 
)

Construct a Tuple node.

Parameters
aritysize of additional inputs array
inadditional inputs

Definition at line 2834 of file gen_irnode.c.

References new_d_Tuple().

void set_Tuple_pred ( ir_node node,
int  pos,
ir_node pred 
)

Set the Tuple pred with index pos.

Definition at line 2849 of file gen_irnode.c.

Variable Documentation

ir_op* op_Tuple

Tuple opcode.

Definition at line 4167 of file nodes.h.

Referenced by get_op_Tuple(), get_Tuple_pred_arr(), new_rd_Tuple(), and set_typeconst_type().