libFirm 1.20
Construction Support

Typedefs

typedef ir_nodeuninitialized_local_variable_func_t (ir_graph *irg, ir_mode *mode, int pos)
 This function is called, whenever a local variable is used before definition.

Functions

ir_graphget_current_ir_graph (void)
 Returns graph which is currently constructed.
void set_current_ir_graph (ir_graph *graph)
 Sets graph which is currently constructed.
ir_nodenew_d_immBlock (dbg_info *db)
 Create an immature Block.
ir_nodenew_immBlock (void)
 Create an immature Block.
ir_nodenew_r_immBlock (ir_graph *irg)
 Create an immature Block.
ir_nodenew_rd_immBlock (dbg_info *db, ir_graph *irg)
 Create an immature Block.
void add_immBlock_pred (ir_node *immblock, ir_node *jmp)
 Add a control flow edge to an immature block.
void mature_immBlock (ir_node *block)
 Finalize a Block node, when all control flows are known.
void set_cur_block (ir_node *target)
 Sets the current block in which the following constructors place the nodes they construct.
void set_r_cur_block (ir_graph *irg, ir_node *target)
 Sets current block of a given graph.
ir_nodeget_cur_block (void)
 Returns the current block of the current graph.
ir_nodeget_r_cur_block (ir_graph *irg)
 Returns current block of a given graph.
ir_nodeget_value (int pos, ir_mode *mode)
 Returns the current value of a local variable.
ir_nodeget_r_value (ir_graph *irg, int pos, ir_mode *mode)
 Returns the current value of a local variable in given graph.
ir_modeir_guess_mode (int pos)
 Try to guess the mode of a local variable.
ir_modeir_r_guess_mode (ir_graph *irg, int pos)
 Try to guess the mode of a local variable in a given graph.
void set_value (int pos, ir_node *value)
 Remark a new definition of a variable.
void set_r_value (ir_graph *irg, int pos, ir_node *value)
 Sets current value of a variable in a given graph.
int find_value (ir_node *value)
 Find the value number for a node in the current block.
int r_find_value (ir_graph *irg, ir_node *value)
 Find value number for a node in the current block of a given graph.
ir_nodeget_store (void)
 Returns the current memory state.
ir_nodeget_r_store (ir_graph *irg)
 Returns current memory state for a given graph.
void set_store (ir_node *store)
 Remark a new definition of the memory state.
void set_r_store (ir_graph *irg, ir_node *store)
 Sets current memory state for a given graph.
void keep_alive (ir_node *ka)
 keep this node alive even if End is not control-reachable from it
void irg_finalize_cons (ir_graph *irg)
 Puts the graph into state "phase_high".
void irp_finalize_cons (void)
 Puts the program and all graphs into state phase_high.
void ir_set_uninitialized_local_variable_func (uninitialized_local_variable_func_t *func)
 Register a new callback for the case that the value of an uninitialized variable is requested.

Variables

ir_graphcurrent_ir_graph
 Global variable holding the graph which is currently constructed.

Typedef Documentation

This function is called, whenever a local variable is used before definition.

Parameters:
irgthe IR graph on which this happens
modethe mode of the local var
posposition chosen be the frontend for this variable (n_loc)
Returns:
a firm node of mode mode that initializes the var at position pos
Note:
Do not return NULL! If this function is not set, FIRM will create a const node with tarval BAD. Use set_irg_loc_description()/get_irg_loc_description() to assign additional informations to local variables.

Definition at line 151 of file firm_types.h.


Function Documentation

void add_immBlock_pred ( ir_node immblock,
ir_node jmp 
)

Add a control flow edge to an immature block.

int find_value ( ir_node value)

Find the value number for a node in the current block.

Parameters:
valuethe searched value
Returns:
the value number of the value or -1 if this value has no value number in the current block.
ir_node* get_cur_block ( void  )

Returns the current block of the current graph.

ir_graph* get_current_ir_graph ( void  )

Returns graph which is currently constructed.

ir_node* get_r_cur_block ( ir_graph irg)

Returns current block of a given graph.

ir_node* get_r_store ( ir_graph irg)

Returns current memory state for a given graph.

See also:
get_store()
ir_node* get_r_value ( ir_graph irg,
int  pos,
ir_mode mode 
)

Returns the current value of a local variable in given graph.

See also:
get_value()
ir_node* get_store ( void  )

Returns the current memory state.

Use this function to obtain the last definition of the memory state. This call automatically inserts Phi nodes for the memory state value.

ir_node* get_value ( int  pos,
ir_mode mode 
)

Returns the current value of a local variable.

Use this function to obtain the last definition of the local variable associated with pos. Pos may not exceed the value passed as n_loc to new_ir_graph. This call automatically inserts Phi nodes.

Parameters:
posThe position/id of the local variable.
*modeThe mode of the value to get.
ir_mode* ir_guess_mode ( int  pos)

Try to guess the mode of a local variable.

This is done by recursively going up the control flow graph until we find a definition for the variable. The mode of the first found definition is returned. NULL in case no definition is found.

Parameters:
posThe position/id of the local variable.
ir_mode* ir_r_guess_mode ( ir_graph irg,
int  pos 
)

Try to guess the mode of a local variable in a given graph.

void ir_set_uninitialized_local_variable_func ( uninitialized_local_variable_func_t func)

Register a new callback for the case that the value of an uninitialized variable is requested.

void irg_finalize_cons ( ir_graph irg)

Puts the graph into state "phase_high".

void irp_finalize_cons ( void  )

Puts the program and all graphs into state phase_high.

This also remarks, the construction of types is finished, e.g., that no more subtypes will be added.

void keep_alive ( ir_node ka)

keep this node alive even if End is not control-reachable from it

Parameters:
kaThe node to keep alive.
void mature_immBlock ( ir_node block)

Finalize a Block node, when all control flows are known.

ir_node* new_d_immBlock ( dbg_info db)

Create an immature Block.

An immature Block has an unknown number of predecessors. Predecessors can be added with add_immBlock_pred(). Once all predecessors are added the block must be matured.

Adds the block to the graph in current_ir_graph. This constructor can only be used if the graph is in state_building.

ir_node* new_immBlock ( void  )

Create an immature Block.

An immature Block has an unknown number of predecessors. Predecessors can be added with add_immBlock_pred(). Once all predecessors are added the block must be matured.

Adds the block to the graph in current_ir_graph. This constructor can only be used if the graph is in state_building.

ir_node* new_r_immBlock ( ir_graph irg)

Create an immature Block.

An immature Block has an unknown number of predecessors. Predecessors can be added with add_immBlock_pred(). Once all predecessors are added the block must be matured.

This constructor can only be used if the graph is in state_building.

ir_node* new_rd_immBlock ( dbg_info db,
ir_graph irg 
)

Create an immature Block.

An immature Block has an unknown number of predecessors. Predecessors can be added with add_immBlock_pred(). Once all predecessors are added the block must be matured.

This constructor can only be used if the graph is in state_building.

int r_find_value ( ir_graph irg,
ir_node value 
)

Find value number for a node in the current block of a given graph.

See also:
find_value()
void set_cur_block ( ir_node target)

Sets the current block in which the following constructors place the nodes they construct.

Parameters:
targetThe new current block.
void set_current_ir_graph ( ir_graph graph)

Sets graph which is currently constructed.

void set_r_cur_block ( ir_graph irg,
ir_node target 
)

Sets current block of a given graph.

See also:
set_cur_block()
void set_r_store ( ir_graph irg,
ir_node store 
)

Sets current memory state for a given graph.

See also:
set_store()
void set_r_value ( ir_graph irg,
int  pos,
ir_node value 
)

Sets current value of a variable in a given graph.

void set_store ( ir_node store)

Remark a new definition of the memory state.

Use this function to remember a new definition of the memory state. This call is needed to automatically inserts Phi nodes.

Parameters:
*storeThe new memory state.
void set_value ( int  pos,
ir_node value 
)

Remark a new definition of a variable.

Use this function to remember a new definition of the value associated with pos. Pos may not exceed the value passed as n_loc to new_ir_graph. This call is needed to automatically inserts Phi nodes.

Parameters:
posThe position/id of the local variable.
*valueThe new value written to the local variable.

Variable Documentation

Global variable holding the graph which is currently constructed.

Definition at line 816 of file ircons.h.