libFirm 1.20
Block node

A basic block. More...

Functions

ir_nodeget_nodes_block (const ir_node *node)
 Returns the block the node belongs to.
void set_nodes_block (ir_node *node, ir_node *block)
 Sets the Block of a node.
int get_Block_n_cfgpreds (const ir_node *block)
 Returns the number of control flow predecessors of a block.
ir_nodeget_Block_cfgpred (const ir_node *block, int pos)
 Returns the control flow predecessor of a block at a given position.
void set_Block_cfgpred (ir_node *block, int pos, ir_node *pred)
 Sets the control flow predecessor of a block at a given position.
int get_Block_cfgpred_pos (const ir_node *block, const ir_node *pred)
 Returns the position of the predecessor block pred in the inputs of the block block.
ir_nodeget_Block_cfgpred_block (const ir_node *node, int pos)
 Returns the predecessor block.
int get_Block_matured (const ir_node *block)
 Returns the matured flag of a block.
void set_Block_matured (ir_node *block, int matured)
 set the matured flag of a block.
ir_visited_t get_Block_block_visited (const ir_node *block)
 A visited flag only for block nodes.
void set_Block_block_visited (ir_node *block, ir_visited_t visit)
 set block visited flag
void mark_Block_block_visited (ir_node *node)
 Marks a block as visited by setting its visited counter.
int Block_block_visited (const ir_node *node)
 Returns 1 if a block is marked as visited.
ir_extblkget_Block_extbb (const ir_node *block)
 Returns the extended basic block a block belongs to.
void set_Block_extbb (ir_node *block, ir_extblk *extblk)
 Sets the extended basic block a block belongs to.
ir_graphget_Block_irg (const ir_node *block)
 Returns the ir_graph this Block belongs to.
ir_entitycreate_Block_entity (ir_node *block)
 Returns the entity for a Block (creating it if necessary)
ir_nodeget_Block_phis (const ir_node *block)
 Returns the head of the Phi list for this block.
void set_Block_phis (ir_node *block, ir_node *phi)
 Sets the head of the Phi list for this block.
void add_Block_phi (ir_node *block, ir_node *phi)
 Add a Phi node to the list of Block Phi's.
unsigned get_Block_mark (const ir_node *block)
 Returns the Block mark (single bit).
void set_Block_mark (ir_node *block, unsigned mark)
 Sets the Block mark (single bit).
ir_nodenew_rd_Block (dbg_info *dbgi, ir_graph *irg, int arity, ir_node *const *in)
 Construct a Block node.
ir_nodenew_r_Block (ir_graph *irg, int arity, ir_node *const *in)
 Construct a Block node.
ir_nodenew_d_Block (dbg_info *dbgi, int arity, ir_node *const *in)
 Construct a Block node.
ir_nodenew_Block (int arity, ir_node *const *in)
 Construct a Block node.
int is_Block (const ir_node *node)
 Test if node is a Block.
ir_entityget_Block_entity (const ir_node *node)
 Returns entity attribute of a Block node.
void set_Block_entity (ir_node *node, ir_entity *entity)
 Sets entity attribute of a Block node.
ir_opget_op_Block (void)
 Returns opcode for Block nodes.

Variables

ir_opop_Block
 Block opcode.

Detailed Description

A basic block.


Function Documentation

void add_Block_phi ( ir_node block,
ir_node phi 
)

Add a Phi node to the list of Block Phi's.

int Block_block_visited ( const ir_node node)

Returns 1 if a block is marked as visited.

ir_entity* create_Block_entity ( ir_node block)

Returns the entity for a Block (creating it if necessary)

ir_visited_t get_Block_block_visited ( const ir_node block)

A visited flag only for block nodes.

See also:
also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()
ir_node* get_Block_cfgpred ( const ir_node block,
int  pos 
)

Returns the control flow predecessor of a block at a given position.

ir_node* get_Block_cfgpred_block ( const ir_node node,
int  pos 
)

Returns the predecessor block.

Returns the block corresponding to the predecessor pos of block.

There are several ambiguities we resolve with this function:

  • The direct predecessor can be a Proj, which is not pinned. We walk from the predecessor to the next pinned node (skip_Proj) and return the block that node is in.
  • If we encounter the Bad node, this function does not return Start block, but the Bad node.
int get_Block_cfgpred_pos ( const ir_node block,
const ir_node pred 
)

Returns the position of the predecessor block pred in the inputs of the block block.

Parameters:
blockthe block
preda predecessor block of block
Returns:
the position of pred in block or -1
Note:
When using the old extended basic block form for blocks with exception exists, a predecessor block might have more than one position. In that case it is not specified, with is returned.
ir_entity* get_Block_entity ( const ir_node node)

Returns entity attribute of a Block node.

ir_extblk* get_Block_extbb ( const ir_node block)

Returns the extended basic block a block belongs to.

ir_graph* get_Block_irg ( const ir_node block)

Returns the ir_graph this Block belongs to.

unsigned get_Block_mark ( const ir_node block)

Returns the Block mark (single bit).

int get_Block_matured ( const ir_node block)

Returns the matured flag of a block.

int get_Block_n_cfgpreds ( const ir_node block)

Returns the number of control flow predecessors of a block.

ir_node* get_Block_phis ( const ir_node block)

Returns the head of the Phi list for this block.

ir_node* get_nodes_block ( const ir_node node)

Returns the block the node belongs to.

This is only possible for pinned nodes or if the graph is in pinned state. Otherwise the block may be incorrect. This condition is now checked by an assertion.

This works for all except Block. It can return Blocks or the Bad node.

To express the difference to access routines that work for all nodes we use infix "nodes" and do not name this function get_irn_block().

ir_op* get_op_Block ( void  )

Returns opcode for Block nodes.

int is_Block ( const ir_node node)

Test if node is a Block.

Returns:
1 if the node is a Block node, 0 otherwise
void mark_Block_block_visited ( ir_node node)

Marks a block as visited by setting its visited counter.

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

Construct a Block node.

Parameters:
aritysize of additional inputs array
inadditional inputs
ir_node* new_d_Block ( dbg_info dbgi,
int  arity,
ir_node *const *  in 
)

Construct a Block node.

Parameters:
dbgiA pointer to debug information.
aritysize of additional inputs array
inadditional inputs
ir_node* new_r_Block ( ir_graph irg,
int  arity,
ir_node *const *  in 
)

Construct a Block node.

Parameters:
irgThe IR graph the node belongs to.
aritysize of additional inputs array
inadditional inputs
ir_node* new_rd_Block ( dbg_info dbgi,
ir_graph irg,
int  arity,
ir_node *const *  in 
)

Construct a Block node.

Parameters:
dbgiA pointer to debug information.
irgThe IR graph the node belongs to.
aritysize of additional inputs array
inadditional inputs
void set_Block_block_visited ( ir_node block,
ir_visited_t  visit 
)

set block visited flag

void set_Block_cfgpred ( ir_node block,
int  pos,
ir_node pred 
)

Sets the control flow predecessor of a block at a given position.

void set_Block_entity ( ir_node node,
ir_entity entity 
)

Sets entity attribute of a Block node.

void set_Block_extbb ( ir_node block,
ir_extblk extblk 
)

Sets the extended basic block a block belongs to.

void set_Block_mark ( ir_node block,
unsigned  mark 
)

Sets the Block mark (single bit).

void set_Block_matured ( ir_node block,
int  matured 
)

set the matured flag of a block.

void set_Block_phis ( ir_node block,
ir_node phi 
)

Sets the head of the Phi list for this block.

void set_nodes_block ( ir_node node,
ir_node block 
)

Sets the Block of a node.


Variable Documentation

Block opcode.

Definition at line 124 of file opcodes.h.