#ifndef FIRM_ANA_HEIGHTS_H
#define FIRM_ANA_HEIGHTS_H
+#include "firm_types.h"
+
typedef struct _heights_t heights_t;
/**
* Represents the default control flow of a Switch-Cond node.
*
* @param *db A pointer for debug information.
- * @param *block The IR block the node belongs to.
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
*
* @param *db A pointer for debug information.
* @param *block The block the node belong to.
- * @param *callee The call node visible in the intra procedural view.
+ * @param *ptr pointer to the called function
+ * @param *call associated call operation
*/
ir_node *new_rd_CallBegin(dbg_info *db, ir_node *block, ir_node *ptr, ir_node *call);
*
* Represents the default control flow of a Switch-Cond node.
*
- * @param *block The IR block the node belongs to.
* @param arg A node producing a tuple.
* @param max_proj The end position of the value in the tuple.
*/
* node.
*
* @param *block The block the node belong to.
- * @param *callee The call node visible in the intra procedural view.
+ * @param *ptr pointer to the called function
+ * @param *call associated call operation
*/
ir_node *new_r_CallBegin(ir_node *block, ir_node *ptr, ir_node *call);
* node.Adds the node to the block in current_ir_block.
*
* @param *db A pointer for debug information.
- * @param *callee The call node visible in the intra procedural view.
+ * @param *ptr pointer to the called function
+ * @param *call associated call operation
*/
ir_node *new_d_CallBegin(dbg_info *db, ir_node *ptr, ir_node *call);
* constructor copies the method pointer input from the passed Call
* node. Adds the node to the block in current_ir_block.
*
- * @param *callee A pointer to the called procedure.
+ * @param *ptr pointer to the called function
+ * @param *call associated call operation
*/
ir_node *new_CallBegin(ir_node *ptr, ir_node *call);
* @return The pre-order number.
*/
unsigned get_Block_dom_tree_pre_num(const ir_node *bl);
+unsigned get_Block_pdom_tree_pre_num(const ir_node *bl);
/**
* Get the largest pre-order number found in the subtree of the
* @return The largest pre-order number of block's dominator subtree.
*/
unsigned get_Block_dom_max_subtree_pre_num(const ir_node *bl);
+unsigned get_Block_pdom_max_subtree_pre_num(const ir_node *bl);
/**
* Get the first node in the list of nodes dominated by a given block.
* @return The first node dominated by @p bl.
*/
ir_node *get_Block_dominated_first(const ir_node *bl);
+ir_node *get_Block_postdominated_first(const ir_node *bl);
/**
* Get the next node in a list of nodes which are dominated by some
* @return The next node in this list or NULL if it was the last.
*/
ir_node *get_Block_dominated_next(const ir_node *dom);
+ir_node *get_Block_postdominated_next(const ir_node *dom);
/**
* Iterate over all nodes which are immediately dominated by a given
* @see turn_off_edge_labels()
*/
void dump_ir_block_graph(ir_graph *irg, const char *suffix);
+
+/**
+ * Does the same as dump_ir_block_graph but dumps to a stream
+ * @see dump_ir_block_graph()
+ */
void dump_ir_block_graph_file(ir_graph *irg, FILE *out);
/** Dump a firm graph without explicit block nodes but grouped in extended blocks.
*
- * @param irg The firm graph to be dumped.
+ * @param irg The firm graph to be dumped.
+ * @param suffix suffix to append after the irgname (but before the .vcg)
*
* @return
* A file containing the firm graph in vcg format.
* @see turn_off_edge_labels()
*/
void dump_ir_extblock_graph(ir_graph *irg, const char *suffix);
+
+/**
+ * Does the same as dump_ir_extrblock_graph but dumps to a stream
+ * @see dump_ir_extblock_graph()
+ */
void dump_ir_extblock_graph_file(ir_graph *irg, FILE *out);
/** Dumps all graphs in interprocedural view to a file named All_graphs\<suffix\>.vcg.
* @see turn_off_edge_labels()
*/
void dump_ir_graph_w_types(ir_graph *irg, const char *suffix);
+
+/**
+ * Does the same as dump_ir_graph_w_types but dumps to a stream
+ * @see dump_ir_graph_w_types()
+ */
void dump_ir_graph_w_types_file(ir_graph *irg, FILE *out);
/** Dumps a firm graph and all the type information needed for Calls,
/** Dumps all global variables as text.
*
- * @param suffix A suffix for the file name.
+ * @param verbosity verbosity flag
+ * @param suffix A suffix for the file name.
*
* Dumps a text representation of the entities in the global type.
*
*/
void set_opt_dump_analysed_type_info(int flag);
+/**
+ * dump iredges (new style out edges)
+ */
+void dump_new_edges(int flag);
+
/** Write the address of a node into the vcg info.
*
* This is off per default for automatic comparisons of
/**
* Sets the visited counter of an extended block.
*
- * @param blk the extended basic block
+ * @param blk the extended basic block
+ * @param visited new value for the visited counter
*/
void set_extbb_visited(ir_extblk *blk, ir_visited_t visited);
void ir_export_file(FILE *output, const char *outputname);
/**
- * Exports the given ir graph to the given file in a textual form.
+ * Write the given ir graph to a stream in a textual format
*
- * @param irg the ir graph
- * @param filename the name of the resulting file
+ * @param irg the ir graph
+ * @param output output stream the irg is written to
+ * @param outputname a name for the output stream (used for error messages)
*
* Exports the type graph used by the given graph and the graph itself.
*/
int is_NoMem(const ir_node *node);
/** Returns true if node is a Start node. */
int is_Start(const ir_node *node);
+/** Returns true if node is an End node. */
+int is_End(const ir_node *node);
+/** Returns true if node is an EndExcept node. */
+int is_EndExcept(const ir_node *node);
+/** Returns true if node is an EndReg node. */
+int is_EndReg(const ir_node *node);
/** Returns true if node is a Minus node. */
int is_Minus(const ir_node *node);
/** Returns true if node is a Abs node. */
int is_Raise(const ir_node *node);
/** Returns true if a node is an ASM node. */
int is_ASM(const ir_node *node);
-/** Returns true if a node is an Dummy node. */
+/** Returns true if a node is a Dummy node. */
int is_Dummy(const ir_node *node);
+/** Returns true if a node is an Anchor node */
+int is_Anchor(const ir_node *node);
+/** Returns true if a node is a Borrow node */
+int is_Borrow(const ir_node *node);
+/** Returns true if a node is a Break node */
+int is_Break(const ir_node *node);
+/** Returns true if a node is an instff node */
+int is_InstOf(const ir_node *node);
/** Returns true if node is a Proj node or a Filter node in INTRA-procedural view. */
int is_Proj(const ir_node *node);
/** Returns true if node is a Filter node. */
int is_irn_forking(const ir_node *node);
/**
- * Copies all attributes stored in the old node to the new node.
+ * Copies attributes stored in the old node to a new node.
* Assumes both have the same opcode and sufficient size.
- * @param irg The irg of the new_node (get_irn_irg on it might not work yet)
+ *
+ * @param irg The irg of the new_node (get_irn_irg on it might not work
+ * yet)
+ * @param old_node the node where the attributes are copied from
+ * @param new_node node the attributes get copies to.
+ *
+ * This copies all essential information to the new node. It does not copy
+ * temporal or calculated information like visited flags or results of dominance
+ * or loop calculations
*/
void copy_node_attr(ir_graph *irg, const ir_node *old_node, ir_node *new_node);
* @param name the name of this pass or NULL
* @param maxsize Do not inline any calls if a method has more than
* maxsize firm nodes. It may reach this limit by
- * inlineing.
+ * inlineing.
* @param inline_threshold inlining threshold
+ * @param after_inline_opt a function that is called after inlining a
+ * procedure. You should run fast local optimisations
+ * here which cleanup the graph before further
+ * inlining
*
* @return the newly created ir_prog pass
*/
unsigned get_entity_alignment(const ir_entity *entity);
/** Allows you to override the type alignment for an entity.
+ * @param entity the entity
* @param alignment alignment in bytes
*/
void set_entity_alignment(ir_entity *entity, unsigned alignment);
/** Create a new method type.
*
- * @param name the name (ident) of this type
* @param n_param the number of parameters
* @param n_res the number of results
*
/** Create a new method type with debug information.
*
- * @param name the name (ident) of this type
* @param n_param the number of parameters
* @param n_res the number of results
* @param db user defined debug information