X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgraph.h;h=af475424c8235262a928051a733aae328b02f713;hb=5f8ddee6b08c8040c0a304a347d65045c1141d52;hp=9a0e41507b2012bc3be955e825432d47e942d450;hpb=4433514e4b01cb3c566d24d671e689f02682f59f;p=libfirm diff --git a/ir/ir/irgraph.h b/ir/ir/irgraph.h index 9a0e41507..af475424c 100644 --- a/ir/ir/irgraph.h +++ b/ir/ir/irgraph.h @@ -8,10 +8,7 @@ # ifndef _IRGRAPH_H_ # define _IRGRAPH_H_ - -# include "obst.h" # include "tv.h" -# include "pset.h" /* to resolve recursion between irnode.h and irgraph.h */ #ifndef _IR_NODE_TYPEDEF_ @@ -19,41 +16,6 @@ typedef struct ir_node ir_node; #endif -/* ir_graph holds all information for a procedure */ -struct ir_graph { - struct entity *ent; /* The entity of this procedure, i.e., - the type of the procedure and the - class it belongs to. */ - struct ir_node *start_block; /* block the start node will belong to */ - struct ir_node *start; /* start node of this ir_graph */ - struct ir_node *end_block; /* block the end node will belong to */ - struct ir_node *end; /* end node of this ir_graph */ - struct ir_node *cstore; /* constant store -- no more needed!! */ - struct ir_node *frame; /* method's frame */ - struct ir_node *globals; /* pointer to the data segment containing all - globals as well as global procedures. */ - struct ir_node *args; /* methods arguments */ - struct ir_node *bad; /* bad node of this ir_graph, the one and - only in this graph */ - struct obstack *obst; /* obstack where all of the ir_nodes live */ -#if USE_EXPICIT_PHI_IN_STACK - struct Phi_in_stack *Phi_in_stack; /* needed for automatic Phi construction */ -#endif - struct ir_node *current_block; /* block for newly gen_*()-erated - ir_nodes */ - int params; /* number of local variable in this - procedure; should be n_loc or so, - params is ambiguous. */ - pset *value_table; /* value table for global value numbering - for optimizing use in iropt.c */ - unsigned long visited; /* this flag is an identifier for - ir walk. it will be incremented, - every time, someone walk through - the graph */ - unsigned long block_visited; /* same as visited, for a - complete block */ -}; - /* to resolve recursion between entity.h and irgraph.h */ #ifndef _IR_GRAPH_TYPEDEF_ #define _IR_GRAPH_TYPEDEF_ @@ -65,10 +27,13 @@ typedef struct ir_graph ir_graph; optimizations. */ extern ir_graph *current_ir_graph; -/* create a new ir graph. Automatically sets the field irg of - entity to the new ir graph. */ -ir_graph *new_ir_graph (entity *ent, int params); - +/* Create a new ir graph to built ir for a procedure. + ent is the entity representing this procedure, i.e., the type of the + entity must be type_method. The constructor automatically sets the + field irg of the entity to the new ir graph. + n_loc is the number of local variables in this procedure including + the procedure parameters. */ +ir_graph *new_ir_graph (entity *ent, int n_loc); /* access routines for all ir_graph attributes */ ir_node *get_irg_start_block (ir_graph *irg); @@ -77,9 +42,6 @@ void set_irg_start_block (ir_graph *irg, ir_node *node); ir_node *get_irg_start (ir_graph *irg); void set_irg_start (ir_graph *irg, ir_node *node); -ir_node *get_start_of_irgraph (ir_graph *irg); -void set_start_of_irgraph(ir_graph *irg, ir_node *node); - ir_node *get_irg_end_block (ir_graph *irg); void set_irg_end_block (ir_graph *irg, ir_node *node); @@ -102,19 +64,15 @@ void set_irg_args (ir_graph *irg, ir_node *node); ir_node *get_irg_bad (ir_graph *irg); void set_irg_bad (ir_graph *irg, ir_node *node); -/* not implemented yet -struct obstack *get_obst_of_irgraph (ir_graph *irg); -void set_obst_of_irgraph (ir_graph *irg, struct obstack *obst); -*/ - ir_node *get_irg_current_block (ir_graph *irg); void set_irg_current_block (ir_graph *irg, ir_node *node); entity *get_irg_ent (ir_graph *irg); void set_irg_ent (ir_graph *irg, entity *ent); -int get_irg_params (ir_graph *irg); -void set_irg_params (ir_graph *irg, int params); +/* Use not encouraged, internal of Phi construction algorithm. */ +int get_irg_n_loc (ir_graph *irg); +void set_irg_n_loc (ir_graph *irg, int n_loc); /* increments visited by one */ void inc_irg_visited(ir_graph *irg); @@ -126,7 +84,4 @@ void inc_irg_block_visited(ir_graph *irg); unsigned long get_irg_block_visited (ir_graph *irg); void set_irg_block_visited(ir_graph *irg, unsigned long i); -int get_params_of_irgraph (ir_graph *irg); -void set_params_of_irgraph (ir_graph *irg, int params); - # endif /* _IRGRAPH_H_ */