intoduced kind field to mode node graph
[libfirm] / ir / ir / ircons.h
index 3c6b8dc..a5d0f1a 100644 (file)
  *    --------------------------------------------
  *
  *    Creates a new Block with the given list of predecessors.  This block
- *    is mature.
+ *    is mature.  As other constructors calls optimization and vrfy for the
+ *    block.  If one of the predecessors is Unknown (as it has to be filled in
+ *    later) optimizations are skipped.  This is necessary to
+ *    construct Blocks in loops.  Leaving Unknown in the Block after finishing
+ *    the construction may have strange effects, especially for interprocedural
+ *    representation and analyses.
  *
  *
  *    CONTROL FLOW OPERATIONS
  *
  *    Creates a Phi node. The in's order has to correspond to the order
  *    of in's of current_block.  This is not checked by the library!
+ *    If one of the predecessors is Unknown (as it has to be filled in
+ *    later) optimizations are skipped.  This is necessary to
+ *    construct Phi nodes in loops.  Leaving Unknown in the Phi after finishing
+ *    the construction may have strange effects, especially for interprocedural
+ *    representation and analyses.
  *
  *    Parameter
  *      arity            number of predecessors
@@ -1155,8 +1165,8 @@ ir_node *new_rd_Tuple  (dbg_info *db, ir_graph *irg, ir_node *block,
                       int arity, ir_node *in[]);
 ir_node *new_rd_Id     (dbg_info *db, ir_graph *irg, ir_node *block,
                       ir_node *val, ir_mode *mode);
-ir_node *new_rd_Bad    ();
-ir_node *new_rd_Unknown();
+ir_node *new_rd_Bad    (ir_graph *irg);
+ir_node *new_rd_Unknown(ir_graph *irg);
 ir_node *new_rd_CallBegin(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *callee);
 ir_node *new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block);
 ir_node *new_rd_EndExcept(dbg_info *db, ir_graph *irg, ir_node *block);
@@ -1247,8 +1257,8 @@ ir_node *new_r_Tuple  (ir_graph *irg, ir_node *block,
                       int arity, ir_node *in[]);
 ir_node *new_r_Id     (ir_graph *irg, ir_node *block,
                       ir_node *val, ir_mode *mode);
-ir_node *new_r_Bad    ();
-ir_node *new_r_Unknown();
+ir_node *new_r_Bad    (ir_graph *irg);
+ir_node *new_r_Unknown(ir_graph *irg);
 ir_node *new_r_CallBegin(ir_graph *irg, ir_node *block, ir_node *callee);
 ir_node *new_r_EndReg (ir_graph *irg, ir_node *block);
 ir_node *new_r_EndExcept(ir_graph *irg, ir_node *block);
@@ -1430,10 +1440,10 @@ void keep_alive (ir_node *ka);
 /* --- Useful access routines --- */
 /** Returns the current block of the current graph.  To set the current
    block use switch_block(). */
-ir_node *get_cur_block();
+ir_node *get_cur_block(void);
 
 /** Returns the frame type of the current graph */
-type *get_cur_frame_type();
+type *get_cur_frame_type(void);
 
 
 /* --- initialize and finalize ir construction --- */
@@ -1441,5 +1451,27 @@ type *get_cur_frame_type();
 /** Puts the graph into state "phase_high" */
 void finalize_cons (ir_graph *irg);
 
+/* --- Initialization --- */
+
+/**
+ * This function is called, whenever a local variable is used before definition
+ *
+ * @parameter mode      the mode of the local var
+ * @pos                 position choosen be the frontend for this var
+ *
+ * @return a firm node of mode @p mode that initialises the var at position pos
+ *
+ * @note
+ *      Do not return NULL
+ *      If this function is not set, FIRM will create a const node with tarval BAD
+ */
+typedef ir_node *default_initialize_local_variable_func_t(ir_mode *mode, int pos);
+
+/**
+ * Initializes the graph construction.
+ *
+ * @param func  @see default_initialize_local_variable_func_t
+ */
+void init_cons (default_initialize_local_variable_func_t *func);
 
 # endif /* _IRCONS_H_ */