X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Firgraph.h;h=53a284b941a2de9a27e788916e740cc1a77c6a39;hb=889c0e4537bfe15888e29c5b41f1eaa1eac94443;hp=caf0659b124b619354a463989d810dceb9252fa8;hpb=cab1ee7a1928e33c8e6be1f6d0319aa1415e42f1;p=libfirm diff --git a/include/libfirm/irgraph.h b/include/libfirm/irgraph.h index caf0659b1..53a284b94 100644 --- a/include/libfirm/irgraph.h +++ b/include/libfirm/irgraph.h @@ -29,10 +29,6 @@ #include #include "firm_types.h" -#include "irop.h" -#include "iropt.h" -#include "irextbb.h" -#include "typerep.h" /** * @page ir_graph The struct ir_graph @@ -206,6 +202,9 @@ ir_type *get_irg_frame_type(ir_graph *irg); /** Sets the frame type of an IR graph. */ void set_irg_frame_type(ir_graph *irg, ir_type *ftp); +/** Returns the value parameter type of an IR graph. */ +ir_type *get_irg_value_param_type(ir_graph *irg); + /** Returns the start block of an IR graph. */ ir_node *get_irg_start_block(const ir_graph *irg); /** Sets the start block of an IR graph. */ @@ -260,11 +259,6 @@ ir_node *get_irg_args(const ir_graph *irg); /** Sets the node that represents the argument pointer of the given IR graph. */ void set_irg_args(ir_graph *irg, ir_node *node); -/** Returns the node that represents the value parameter base pointer of the given IR graph. */ -ir_node *get_irg_value_param_base(const ir_graph *irg); -/** Sets the node that represents the value parameter base pointer of the given IR graph. */ -void set_irg_value_param_base(ir_graph *irg, ir_node *node); - /** Returns the current block of an IR graph. */ ir_node *get_irg_current_block(const ir_graph *irg); /** Sets the current block of an IR graph. */ @@ -291,6 +285,16 @@ long get_irg_graph_nr(const ir_graph *irg); */ int get_irg_idx(const ir_graph *irg); +/** + * Get the node for an index. + * @param irg The graph. + * @param idx The index you want the node for. + * @return The node with that index or NULL, if there is no node with that index. + * @note The node you got might be dead. + */ +ir_node *get_idx_irn(ir_graph *irg, unsigned idx); + + /********************************************************************************/ /* States of an ir_graph. */ /********************************************************************************/ @@ -392,13 +396,10 @@ typedef enum { loopinfo_cf = 4, /**< Loop information constructed for control flow only. */ loopinfo_inter = 8, /**< Loop information for interprocedural view. */ - loopinfo_for_firmjni = 16, /**< A hack for firmjni: all enums must differ as they - are used in a switch. */ - /** IntRAprocedural loop information constructed and valid. */ - loopinfo_consistent = loopinfo_constructed | loopinfo_for_firmjni | loopinfo_valid, + loopinfo_consistent = loopinfo_constructed | loopinfo_valid, /** IntRAprocedural loop information constructed and invalid. */ - loopinfo_inconsistent = loopinfo_constructed | loopinfo_for_firmjni, + loopinfo_inconsistent = loopinfo_constructed, /** IntERprocedural loop information constructed and valid. */ loopinfo_ip_consistent = loopinfo_constructed | loopinfo_inter | loopinfo_valid, @@ -509,12 +510,22 @@ void set_irg_block_visited(ir_graph *irg, ir_visited_t i); * if 2 parties try to use the flags. */ enum ir_resources_enum_t { + /* local (irg) resources */ IR_RESOURCE_BLOCK_VISITED = 1 << 0, /**< Block visited flags are used. */ IR_RESOURCE_BLOCK_MARK = 1 << 1, /**< Block mark bits are used. */ IR_RESOURCE_IRN_VISITED = 1 << 2, /**< IR-node visited flags are used. */ IR_RESOURCE_IRN_LINK = 1 << 3, /**< IR-node link fields are used. */ IR_RESOURCE_LOOP_LINK = 1 << 4, /**< IR-loop link fields are used. */ - IR_RESOURCE_ENTITY_LINK = 1 << 5 /**< IR-entity link fields are used. */ + IR_RESOURCE_PHI_LIST = 1 << 5, /**< Block Phi lists are used. */ + IR_RESOURCE_IRG_LINK = 1 << 6, /**< IR-graph link fields used. */ + + /* global (irp) resources */ + IR_RESOURCE_ENTITY_LINK = 1 << 8, /**< IR-entity link fields are used. */ + IR_RESOURCE_TYPE_VISITED = 1 << 9, /**< type visited flags */ + + /* masks */ + IR_RESOURCE_LOCAL_MASK = 0x00FF, /**< Mask for all local resources. */ + IR_RESOURCE_GLOBAL_MASK = 0xFF00 /**< Mask for all global resources. */ }; typedef unsigned ir_resources_t; @@ -523,11 +534,26 @@ void ir_reserve_resources(ir_graph *irg, ir_resources_t resources); void ir_free_resources(ir_graph *irg, ir_resources_t resources); ir_resources_t ir_resources_reserved(const ir_graph *irg); #else -#define ir_reserve_resources(irg,resources) -#define ir_free_resources(irg,resources) +#define ir_reserve_resources(irg,resources) (void)0 +#define ir_free_resources(irg,resources) (void)0 #define ir_resources_reserved(irg) 0 #endif +/** + * Graph State + */ +typedef enum { + IR_GRAPH_STATE_KEEP_MUX = 1 << 0, /**< should perform no further optimisations on Mux nodes */ + IR_GRAPH_STATE_ARCH_DEP = 1 << 1, /**< should not construct more nodes which irarch potentially breaks down */ +} ir_graph_state_t; + +/** set some state flags on the graph (this does not clear the other flags) */ +void set_irg_state(ir_graph *irg, ir_graph_state_t state); +/** clear some state flags of the graph */ +void clear_irg_state(ir_graph *irg, ir_graph_state_t state); +/** query wether a set of graph state flags are activated */ +int is_irg_state(const ir_graph *irg, ir_graph_state_t state); + /** Normalization: Move Proj nodes into the same block as its predecessors */ void normalize_proj_nodes(ir_graph *irg);