libFirm
irtypeinfo.h File Reference

Data structure to hold type information for nodes. More...

#include "firm_types.h"
#include "begin.h"
#include "end.h"

Go to the source code of this file.

Enumerations

enum  ir_typeinfo_state { ir_typeinfo_none, ir_typeinfo_consistent, ir_typeinfo_inconsistent }
 typeinfo information state More...

Functions

void init_irtypeinfo (void)
 Initializes the type information module.
void free_irtypeinfo (void)
 Frees memory used by the type information module.
void set_irg_typeinfo_state (ir_graph *irg, ir_typeinfo_state state)
 Sets state of typeinfo information in graph irg to state.
ir_typeinfo_state get_irg_typeinfo_state (const ir_graph *irg)
 Returns state of typeinfo information in graph irg.
ir_typeinfo_state get_irp_typeinfo_state (void)
 Returns accumulated type information state information.
void set_irp_typeinfo_state (ir_typeinfo_state state)
 Sets state of typeinfo information for the current program to state.
void set_irp_typeinfo_inconsistent (void)
 Sets state of typeinfo information for the current program to ir_typeinfo_inconsistent.
ir_typeget_irn_typeinfo_type (const ir_node *n)
 Accessing the type information.
void set_irn_typeinfo_type (ir_node *node, ir_type *type)
 Sets type information of procedure graph node node to type type.

Variables

ir_typeinitial_type
 An auxiliary type used to express that a field is uninitialized.

Detailed Description

Data structure to hold type information for nodes.

Author
Goetz Lindenmaier
Date
28.8.2003

Data structure to hold type information for nodes.

This module defines a field "type" of type "type *" for each ir node. It defines a flag for irgraphs to mark whether the type info of the graph is valid. Further it defines an auxiliary type "init_type".

Definition in file irtypeinfo.h.

Enumeration Type Documentation

typeinfo information state

Enumerator:
ir_typeinfo_none 

No typeinfo computed, calls to set/get_irn_typeinfo_type() are invalid.

ir_typeinfo_consistent 

Type info valid, calls to set/get_irn_typeinfo_type() return the proper type.

ir_typeinfo_inconsistent 

Type info can be accessed, but it can be invalid because of other transformations.

Definition at line 66 of file irtypeinfo.h.

Function Documentation

void free_irtypeinfo ( void  )

Frees memory used by the type information module.

ir_typeinfo_state get_irg_typeinfo_state ( const ir_graph irg)

Returns state of typeinfo information in graph irg.

ir_type* get_irn_typeinfo_type ( const ir_node n)

Accessing the type information.

These routines only work properly if the ir_graph is in state ir_typeinfo_consistent or ir_typeinfo_inconsistent. They assume current_ir_graph set properly.

ir_typeinfo_state get_irp_typeinfo_state ( void  )

Returns accumulated type information state information.

Returns ir_typeinfo_consistent if the type information of all irgs is consistent. Returns ir_typeinfo_inconsistent if at least one irg has inconsistent or no type information. Returns ir_typeinfo_none if no irg contains type information.

void init_irtypeinfo ( void  )

Initializes the type information module.

Initializes the type information module. Generates a type inititial_type and sets the type of all nodes to this type. Calling set/get_irn_typeinfo_type() is invalid before calling init. Requires memory in the order of MIN(<calls to set_irn_typeinfo_type>, #irnodes).

void set_irg_typeinfo_state ( ir_graph irg,
ir_typeinfo_state  state 
)

Sets state of typeinfo information in graph irg to state.

void set_irn_typeinfo_type ( ir_node node,
ir_type type 
)

Sets type information of procedure graph node node to type type.

void set_irp_typeinfo_inconsistent ( void  )

Sets state of typeinfo information for the current program to ir_typeinfo_inconsistent.

void set_irp_typeinfo_state ( ir_typeinfo_state  state)

Sets state of typeinfo information for the current program to state.

Variable Documentation

ir_type* initial_type

An auxiliary type used to express that a field is uninitialized.

This auxiliary type expresses that a field is uninitialized. The variable is initialized by init_irtypeinfo(). The type is freed by free_irtypeinfo().

Definition at line 46 of file irtypeinfo.h.