libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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. More...
 

Functions

ir_graphget_current_ir_graph (void)
 Returns graph which is currently constructed. More...
 
void set_current_ir_graph (ir_graph *graph)
 Sets graph which is currently constructed. More...
 
ir_nodenew_d_immBlock (dbg_info *db)
 Create an immature Block. More...
 
ir_nodenew_immBlock (void)
 Create an immature Block. More...
 
ir_nodenew_r_immBlock (ir_graph *irg)
 Create an immature Block. More...
 
ir_nodenew_rd_immBlock (dbg_info *db, ir_graph *irg)
 Create an immature Block. More...
 
void add_immBlock_pred (ir_node *immblock, ir_node *jmp)
 Add a control flow edge to an immature block. More...
 
void mature_immBlock (ir_node *block)
 Finalize a Block node, when all control flows are known. More...
 
void set_cur_block (ir_node *target)
 Sets the current block in which the following constructors place the nodes they construct. More...
 
void set_r_cur_block (ir_graph *irg, ir_node *target)
 Sets current block of a given graph. More...
 
ir_nodeget_cur_block (void)
 Returns the current block of the current graph. More...
 
ir_nodeget_r_cur_block (ir_graph *irg)
 Returns current block of a given graph. More...
 
ir_nodeget_value (int pos, ir_mode *mode)
 Returns the current value of a local variable. More...
 
ir_nodeget_r_value (ir_graph *irg, int pos, ir_mode *mode)
 Returns the current value of a local variable in given graph. More...
 
ir_modeir_guess_mode (int pos)
 Try to guess the mode of a local variable. More...
 
ir_modeir_r_guess_mode (ir_graph *irg, int pos)
 Try to guess the mode of a local variable in a given graph. More...
 
void set_value (int pos, ir_node *value)
 Memorize a new definition of a variable. More...
 
void set_r_value (ir_graph *irg, int pos, ir_node *value)
 Sets current value of a variable in a given graph. More...
 
ir_nodeget_store (void)
 Returns the current memory state. More...
 
ir_nodeget_r_store (ir_graph *irg)
 Returns current memory state for a given graph. More...
 
void set_store (ir_node *store)
 Memorize a new definition of the memory state. More...
 
void set_r_store (ir_graph *irg, ir_node *store)
 Sets current memory state for a given graph. More...
 
void keep_alive (ir_node *ka)
 keep this node alive even if End is not control-reachable from it More...
 
void irg_finalize_cons (ir_graph *irg)
 Puts the graph into state "phase_high". More...
 
void verify_new_node (ir_node *node)
 If firm is built in debug mode, verify that a newly created node is fine. More...
 
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. More...
 

Variables

ir_graphcurrent_ir_graph
 Global variable holding the graph which is currently constructed. More...
 

Detailed Description

Typedef Documentation

typedef ir_node* uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos)

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 an Unknown node. Use set_irg_loc_description()/get_irg_loc_description() to assign additional informations to local variables.

Definition at line 120 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.

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 must be less than 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 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.

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)

Memorize 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 
)

Memorize a new definition of a variable.

Use this function to remember a new definition of the value associated with pos. pos must be less than 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