ir_graph *get_current_ir_graph(void);
void set_current_ir_graph(ir_graph *graph);
+#ifdef INTERPROCEDURAL_VIEW
/** This flag indicate the current view. The behavior of some methods
* (get_irn_*, set_irn_*) is influenced by this flag. */
int get_interprocedural_view(void);
void set_interprocedural_view(int state);
+#else
+#define get_interprocedural_view() 0
+#endif
/**
* Create a new ir graph to build ir for a procedure.
* (and probably most standard Firm are removed).
*/
typedef enum {
- phase_building,
- phase_high,
- phase_low,
- phase_backend
+ phase_building, /**< The graph is still being constructed. */
+ phase_high, /**< The construction of the graph is finish, high level nodes may be present. */
+ phase_low, /**< High level nodes are removed. */
+ phase_backend /**< The graph is taken by the backend. Machine specific nodes may be present. */
} irg_phase_state;
/** returns the phase_state of an IR graph. */
* Outs are the back edges or def-use edges of ir nodes.
* Values: outs_none, outs_consistent, outs_inconsistent */
typedef enum {
- outs_none, /**< Outs are not computed, no memory is allocated. */
- outs_consistent, /**< Outs are computed and correct. */
- outs_inconsistent /**< Outs have been computed, memory is still allocated,
- but the graph has been changed since. */
+ outs_none, /**< Outs are not computed, no memory is allocated. */
+ outs_consistent, /**< Outs are computed and correct. */
+ outs_inconsistent /**< Outs have been computed, memory is still allocated,
+ but the graph has been changed since. */
} irg_outs_state;
irg_outs_state get_irg_outs_state(const ir_graph *irg);
void set_irg_outs_inconsistent(ir_graph *irg);
/** state: extended basic block state. */
typedef enum {
- extblk_none = 0, /**< No extended basic block information is constructed. Default. */
- extblk_valid = 1, /**< Extended basic block information is valid. */
- extblk_invalid = 2 /**< Extended basic block information is constructed but invalid. */
+ extblk_none = 0, /**< No extended basic block information is constructed. Default. */
+ extblk_valid = 1, /**< Extended basic block information is valid. */
+ extblk_invalid = 2 /**< Extended basic block information is constructed but invalid. */
} irg_extblk_state;
irg_extblk_state get_irg_extblk_state(const ir_graph *irg);
void set_irg_extblk_inconsistent(ir_graph *irg);
* Signals the state of the dominator / post dominator information.
*/
typedef enum {
- dom_none, /**< dominator are not computed, no memory is allocated */
- dom_consistent, /**< dominator information is computed and correct */
- dom_inconsistent /**< dominator information is computed but the graph has been changed since */
+ dom_none, /**< dominator are not computed, no memory is allocated */
+ dom_consistent, /**< dominator information is computed and correct */
+ dom_inconsistent /**< dominator information is computed but the graph has been changed since */
} irg_dom_state;
/** returns the dominator state of an IR graph. */
* data flow of the procedure.
*/
typedef enum {
- loopinfo_none = 0, /**< No loop information is constructed. Default. */
- loopinfo_constructed = 1, /**< Some kind of loop information is constructed. */
- loopinfo_valid = 2, /**< Loop information is valid. */
- 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,
- /** IntRAprocedural loop information constructed and invalid. */
- loopinfo_inconsistent = loopinfo_constructed | loopinfo_for_firmjni,
-
- /** IntERprocedural loop information constructed and valid. */
- loopinfo_ip_consistent = loopinfo_constructed | loopinfo_inter | loopinfo_valid,
- /** IntERprocedural loop information constructed and invalid. */
- loopinfo_ip_inconsistent = loopinfo_constructed | loopinfo_inter,
-
- /** IntRAprocedural control loop information constructed and valid. */
- loopinfo_cf_consistent = loopinfo_constructed | loopinfo_cf | loopinfo_valid,
- /** IntRAprocedural control loop information constructed and invalid. */
- loopinfo_cf_inconsistent = loopinfo_constructed | loopinfo_cf,
-
- /** IntERprocedural control loop information constructed and valid. */
- loopinfo_cf_ip_consistent = loopinfo_constructed | loopinfo_cf | loopinfo_inter | loopinfo_valid,
- /** IntERprocedural control loop information constructed and invalid. */
- loopinfo_cf_ip_inconsistent = loopinfo_constructed | loopinfo_cf | loopinfo_inter
+ loopinfo_none = 0, /**< No loop information is constructed. Default. */
+ loopinfo_constructed = 1, /**< Some kind of loop information is constructed. */
+ loopinfo_valid = 2, /**< Loop information is valid. */
+ 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,
+ /** IntRAprocedural loop information constructed and invalid. */
+ loopinfo_inconsistent = loopinfo_constructed | loopinfo_for_firmjni,
+
+ /** IntERprocedural loop information constructed and valid. */
+ loopinfo_ip_consistent = loopinfo_constructed | loopinfo_inter | loopinfo_valid,
+ /** IntERprocedural loop information constructed and invalid. */
+ loopinfo_ip_inconsistent = loopinfo_constructed | loopinfo_inter,
+
+ /** IntRAprocedural control loop information constructed and valid. */
+ loopinfo_cf_consistent = loopinfo_constructed | loopinfo_cf | loopinfo_valid,
+ /** IntRAprocedural control loop information constructed and invalid. */
+ loopinfo_cf_inconsistent = loopinfo_constructed | loopinfo_cf,
+
+ /** IntERprocedural control loop information constructed and valid. */
+ loopinfo_cf_ip_consistent = loopinfo_constructed | loopinfo_cf | loopinfo_inter | loopinfo_valid,
+ /** IntERprocedural control loop information constructed and invalid. */
+ loopinfo_cf_ip_inconsistent = loopinfo_constructed | loopinfo_cf | loopinfo_inter
} irg_loopinfo_state;
/** Return the current loop information state. */
* information must be computed for the whole program, or not?
*/
typedef enum {
- irg_callee_info_none,
- irg_callee_info_consistent,
- irg_callee_info_inconsistent
+ irg_callee_info_none,
+ irg_callee_info_consistent,
+ irg_callee_info_inconsistent
} irg_callee_info_state;
/** returns the callee_info_state of an IR graph. */
* Tells how to handle an ir graph in inlineing.
*/
typedef enum {
- irg_inline_any, /**< No restriction on inlineing. Default. */
- irg_inline_forbidden, /**< The graph may not be inlined. */
- irg_inline_recomended, /**< The graph should be inlined. */
- irg_inline_forced, /**< The graph must be inlined. */
- irg_inline_forced_no_body /**< The graph must be inlined. No body is allowed
- to be emitted. */
+ irg_inline_any, /**< No restriction on inlineing. Default. */
+ irg_inline_forbidden, /**< The graph may not be inlined. */
+ irg_inline_recomended, /**< The graph should be inlined. */
+ irg_inline_forced, /**< The graph must be inlined. */
+ irg_inline_forced_no_body /**< The graph must be inlined. No body is allowed
+ to be emitted. */
} irg_inline_property;
/** Returns the inline property of a graph. */
* The properties are automatically inherited from the method type
* if they were not set using set_irg_additional_properties() or
* set_irg_additional_property().
+ *
+ * @return a bitset of mtp_additional_property values
*/
unsigned get_irg_additional_properties(const ir_graph *irg);
void set_irg_block_visited (ir_graph *irg, unsigned long i);
/**
- * Debug helpers: You can indicate wether you are currently using visited or
+ * Debug helpers: You can indicate whether you are currently using visited or
* block_visited flags. If NDEBUG is not defined, then the compiler will abort
* if 2 parties try to use the flags.
*/
static INLINE int using_irn_link(const ir_graph *irg) { (void) irg; return 0; }
#endif
-/** move Proj nodes into the same block as its predecessors */
+/** Normalization: Move Proj nodes into the same block as its predecessors */
void normalize_proj_nodes(ir_graph *irg);
/** set a description for local value n */
* @return A pointer of type @p type.
*/
#define get_irg_data(graph,type,off) \
- (assert(off > 0 && "Invalid graph data offset"), (type *) ((char *) (graph) - (off)))
+ (assert(off > 0 && "Invalid graph data offset"), (type *) ((char *) (graph) - (off)))
/**
* Get the pointer to the node some custom data belongs to.
* @return A pointer to the ir node the custom data belongs to.
*/
#define get_irg_data_base(data,off) \
- (assert(off > 0 && "Invalid graph data offset"), (ir_graph *) ((char *) (data) + (off)))
+ (assert(off > 0 && "Invalid graph data offset"), (ir_graph *) ((char *) (data) + (off)))
/**
* Request additional data to be allocated with an ir graph.