X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firgraph_t.h;h=af9bf68de221a35900813ffa6fe808f26084d659;hb=672b5c243e900427b5dcae01441d4fa3327d692c;hp=9bea0eea60279c2c4d1268602a56a0c4ade6b866;hpb=6be9d429e8a25e1a818b9912ca3c038d020c4f8d;p=libfirm diff --git a/ir/ir/irgraph_t.h b/ir/ir/irgraph_t.h index 9bea0eea6..af9bf68de 100644 --- a/ir/ir/irgraph_t.h +++ b/ir/ir/irgraph_t.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -47,25 +47,44 @@ #define FRAME_TP_SUFFIX "frame_tp" /** - * Initializes the graph construction module + * Initializes the graph construction module. */ void firm_init_irgraph(void); -/* Internal constructor that does not add to irp_irgs or the like. */ -ir_graph *new_r_ir_graph (ir_entity *ent, int n_loc); +/** + * Set the number of locals for a given graph. + * + * @param irg the graph + * @param n_loc number of locals + */ +void irg_set_nloc(ir_graph *res, int n_loc); + +/** + * Internal constructor that does not add to irp_irgs or the like. + */ +ir_graph *new_r_ir_graph(ir_entity *ent, int n_loc); -/** Make a rudimentary ir graph for the constant code. - Must look like a correct irg, spare everything else. */ +/** + * Make a rudimentary ir graph for the constant code. + * Must look like a correct irg, spare everything else. + */ ir_graph *new_const_code_irg(void); +/** + * Create a new graph that is a copy of a given one. + * Uses the link fields of the original graphs. + * + * @param irg The graph that must be copied. + */ +ir_graph *create_irg_copy(ir_graph *irg); + /** * Set the op_pin_state_pinned state of a graph. * * @param irg the IR graph * @param p new pin state */ -INLINE void -set_irg_pinned (ir_graph *irg, op_pin_state p); +void set_irg_pinned(ir_graph *irg, op_pin_state p); /** Returns the obstack associated with the graph. */ struct obstack *get_irg_obstack(const ir_graph *irg); @@ -82,13 +101,6 @@ int node_is_in_irgs_storage(ir_graph *irg, ir_node *n); /* inline functions for graphs */ /*-------------------------------------------------------------------*/ -extern int firm_interprocedural_view; - -static INLINE int -_get_interprocedural_view(void) { - return firm_interprocedural_view; -} - static INLINE int _is_ir_graph(const void *thing) { return (get_kind(thing) == k_ir_graph); @@ -157,23 +169,23 @@ _set_irg_end_except(ir_graph *irg, ir_node *node) { } static INLINE ir_node * -_get_irg_frame(const ir_graph *irg) { - return get_irn_intra_n(irg->anchor, anchor_frame); +_get_irg_initial_exec(const ir_graph *irg) { + return get_irn_intra_n(irg->anchor, anchor_initial_exec); } static INLINE void -_set_irg_frame(ir_graph *irg, ir_node *node) { - set_irn_n(irg->anchor, anchor_frame, node); +_set_irg_initial_exec(ir_graph *irg, ir_node *node) { + set_irn_n(irg->anchor, anchor_initial_exec, node); } static INLINE ir_node * -_get_irg_globals(const ir_graph *irg) { - return get_irn_intra_n(irg->anchor, anchor_globals); +_get_irg_frame(const ir_graph *irg) { + return get_irn_intra_n(irg->anchor, anchor_frame); } static INLINE void -_set_irg_globals(ir_graph *irg, ir_node *node) { - set_irn_n(irg->anchor, anchor_globals, node); +_set_irg_frame(ir_graph *irg, ir_node *node) { + set_irn_n(irg->anchor, anchor_frame, node); } static INLINE ir_node * @@ -216,16 +228,6 @@ _set_irg_value_param_base(ir_graph *irg, ir_node *node) { set_irn_n(irg->anchor, anchor_value_param_base, node); } -static INLINE ir_node ** -_get_irg_proj_args(const ir_graph *irg) { - return irg->proj_args; -} - -static INLINE void -_set_irg_proj_args(ir_graph *irg, ir_node **nodes) { - irg->proj_args = nodes; -} - static INLINE ir_node * _get_irg_bad(const ir_graph *irg) { return get_irn_intra_n(irg->anchor, anchor_bad); @@ -521,8 +523,17 @@ set_irg_anchor(ir_graph *irg, int idx, ir_node *irn) { set_irn_n(irg->anchor, idx, irn); } +#ifdef INTERPROCEDURAL_VIEW +extern int firm_interprocedural_view; + +static INLINE int +_get_interprocedural_view(void) { + return firm_interprocedural_view; +} #define get_interprocedural_view() _get_interprocedural_view() +#endif + #define is_ir_graph(thing) _is_ir_graph(thing) #define get_irg_start_block(irg) _get_irg_start_block(irg) #define set_irg_start_block(irg, node) _set_irg_start_block(irg, node) @@ -536,10 +547,10 @@ set_irg_anchor(ir_graph *irg, int idx, ir_node *irn) { #define set_irg_end_reg(irg, node) _set_irg_end_reg(irg, node) #define get_irg_end_except(irg) _get_irg_end_except(irg) #define set_irg_end_except(irg, node) _set_irg_end_except(irg, node) +#define get_irg_initial_exec(irg) _get_irg_initial_exec(irg) +#define set_irg_initial_exec(irg, node) _set_irg_initial_exec(irg, node) #define get_irg_frame(irg) _get_irg_frame(irg) #define set_irg_frame(irg, node) _set_irg_frame(irg, node) -#define get_irg_globals(irg) _get_irg_globals(irg) -#define set_irg_globals(irg, node) _set_irg_globals(irg, node) #define get_irg_tls(irg) _get_irg_tls(irg) #define set_irg_tls(irg, node) _set_irg_tls(irg, node) #define get_irg_initial_mem(irg) _get_irg_initial_mem(irg)