make sure backedges are available before dumping them
[libfirm] / ir / ir / irnode.h
index a655855..89e10ce 100644 (file)
 
 #include <stddef.h>
 
-#include "irgraph.h"
-#include "entity.h"
 #include "firm_common.h"
+#include "entity.h"
 #include "irop.h"
 #include "irmode.h"
-#include "type.h"
-#include "irextbb.h"
 #include "dbginfo.h"
 
 /**
@@ -177,7 +174,7 @@ ir_op *get_irn_op(const ir_node *node);
 /** Sets the opcode struct of the node. */
 void set_irn_op(ir_node *node, ir_op *op);
 /** Gets the opcode-enum of the node. */
-opcode get_irn_opcode(const ir_node *node);
+ir_opcode get_irn_opcode(const ir_node *node);
 /** Get the string representation of the opcode. */
 const char *get_irn_opname(const ir_node *node);
 /** Get the ident for a string representation of the opcode. */
@@ -391,6 +388,9 @@ void set_End_keepalive(ir_node *end, int pos, ir_node *ka);
 /** Set new keep-alives */
 void set_End_keepalives(ir_node *end, int n, ir_node *in[]);
 
+/* Set new keep-alives from old keep-alives, skipping irn */
+void remove_End_keepalive(ir_node *end, ir_node *irn);
+
 /** Some parts of the End node are allocated separately -- their memory
    is not recovered by dead_node_elimination if a End node is dead.
    free_End() frees these data structures. */
@@ -494,6 +494,8 @@ typedef enum {
   symconst_addr_ent,    /**< The SymConst is a symbolic pointer to be filled in
                              by the linker.  The pointer is represented by an entity.
                              symconst_symbol is entity *. */
+  symconst_ofs_ent,     /**< The SymConst is the offset of its entity in the entities
+                             owner type. */
   symconst_enum_const   /**< The SymConst is a enumeration constant of an
                              enumeration type. */
 } symconst_kind;
@@ -505,7 +507,7 @@ typedef enum {
 #define SYMCONST_HAS_ID(kind) ((kind) == symconst_addr_name)
 
 /** Returns non-zero if s symconst kind has an entity attribute */
-#define SYMCONST_HAS_ENT(kind) ((kind) == symconst_addr_ent)
+#define SYMCONST_HAS_ENT(kind) ((kind) == symconst_addr_ent || (kind) == symconst_ofs_ent)
 
 /** Returns non-zero if s symconst kind has an enum_const attribute */
 #define SYMCONST_HAS_ENUM(kind) ((kind) == symconst_enum_const)
@@ -515,10 +517,10 @@ typedef enum {
  *  This union contains the symbolic information represented by the node.
  */
 typedef union symconst_symbol {
-  ir_type       *type_p;
-  ident         *ident_p;
-  entity        *entity_p;
-  ir_enum_const *enum_p;
+  ir_type       *type_p;    /**< the type of a symconst */
+  ident         *ident_p;   /**< the ident of a symconst */
+  ir_entity     *entity_p;  /**< the entity of a symconst */
+  ir_enum_const *enum_p;    /**< the enumeration constant of a symconst */
 } symconst_symbol;
 
 /** Get the kind of the SymConst. */
@@ -535,8 +537,8 @@ ident   *get_SymConst_name(ir_node *node);
 void     set_SymConst_name(ir_node *node, ident *name);
 
 /** Only to access SymConst of kind addr_ent.  Else assertion: */
-entity  *get_SymConst_entity(ir_node *node);
-void     set_SymConst_entity(ir_node *node, entity *ent);
+ir_entity *get_SymConst_entity(ir_node *node);
+void       set_SymConst_entity(ir_node *node, ir_entity *ent);
 
 /** Only to access SymConst of kind symconst_enum_const.  Else assertion: */
 ir_enum_const *get_SymConst_enum(ir_node *node);
@@ -555,16 +557,16 @@ void                  set_SymConst_symbol(ir_node *node,
 ir_type *get_SymConst_value_type(ir_node *node);
 void    set_SymConst_value_type(ir_node *node, ir_type *tp);
 
-ir_node *get_Sel_mem(ir_node *node);
-void     set_Sel_mem(ir_node *node, ir_node *mem);
-ir_node *get_Sel_ptr(ir_node *node);  /* ptr to the object to select from */
-void     set_Sel_ptr(ir_node *node, ir_node *ptr);
-ir_node **get_Sel_index_arr(ir_node *node);
-int      get_Sel_n_indexs(ir_node *node);
-ir_node *get_Sel_index(ir_node *node, int pos);
-void     set_Sel_index(ir_node *node, int pos, ir_node *index);
-entity  *get_Sel_entity(ir_node *node); /* entity to select */
-void     set_Sel_entity (ir_node *node, entity *ent);
+ir_node   *get_Sel_mem(ir_node *node);
+void       set_Sel_mem(ir_node *node, ir_node *mem);
+ir_node   *get_Sel_ptr(ir_node *node);  /* ptr to the object to select from */
+void       set_Sel_ptr(ir_node *node, ir_node *ptr);
+ir_node   **get_Sel_index_arr(ir_node *node);
+int        get_Sel_n_indexs(ir_node *node);
+ir_node   *get_Sel_index(ir_node *node, int pos);
+void       set_Sel_index(ir_node *node, int pos, ir_node *index);
+ir_entity *get_Sel_entity(ir_node *node); /* entity to select */
+void       set_Sel_entity (ir_node *node, ir_entity *ent);
 
 /**
  * Projection numbers for result of Call node: use for Proj nodes!
@@ -616,14 +618,14 @@ int      get_Call_arity(ir_node *node);
  *
  *  @param node A Call node.
  */
-int     Call_has_callees(ir_node *node);
-int     get_Call_n_callees(ir_node *node);
-entity *get_Call_callee(ir_node *node, int pos);
+int        Call_has_callees(ir_node *node);
+int        get_Call_n_callees(ir_node *node);
+ir_entity *get_Call_callee(ir_node *node, int pos);
 
 /** Set the full callee array.
  *
  *  The passed array is copied. Assumes current_ir_graph set properly! */
-void    set_Call_callee_arr(ir_node *node, const int n, entity **arr);
+void    set_Call_callee_arr(ir_node *node, const int n, ir_entity **arr);
 void    remove_Call_callee_arr(ir_node *node);
 
 ir_node  *get_CallBegin_ptr(ir_node *node);
@@ -1109,6 +1111,8 @@ void    set_Pin_op(ir_node *pin, ir_node *node);
 
 /** returns operand of node if node is a Proj. */
 ir_node *skip_Proj(ir_node *node);
+/** returns operand of node if node is a Proj. */
+const ir_node *skip_Proj_const(const ir_node *node);
 /** returns operand of node if node is a Id */
 ir_node *skip_Id(ir_node *node);   /* Old name is skip_nop(). */
 /** returns corresponding operand of Tuple if node is a Proj from
@@ -1121,9 +1125,19 @@ ir_node *skip_Confirm(ir_node *node);
 /** Skip all high-level Operations. */
 ir_node *skip_HighLevel(ir_node *node);
 /** returns true if irn is a Const node. */
-int                     is_Const(const ir_node *node);
+int      is_Const(const ir_node *node);
 /** returns true if node is a Bad node. */
 int      is_Bad(const ir_node *node);
+/** returns true if node is a NoMem node. */
+int      is_NoMem(const ir_node *node);
+/** returns true if node is a Start node. */
+int      is_Start(const ir_node *node);
+/** return true if node is a Mod node. */
+int      is_Mod(const ir_node *node);
+/** return true if node is a Div node. */
+int      is_Div(const ir_node *node);
+/** return true if node is a DivMod node. */
+int      is_DivMod(const ir_node *node);
 /** returns true if the node is not a Block */
 int      is_no_Block(const ir_node *node);
 /** returns true if the node is a Block */
@@ -1140,6 +1154,8 @@ int      is_Sel(const ir_node *node);
 int      is_Mux(const ir_node *node);
 /** returns true if node is a Load node. */
 int      is_Load(const ir_node *node);
+/** returns true if node is a Store node. */
+int      is_Store(const ir_node *node);
 /** returns true if node is a Sync node. */
 int      is_Sync(const ir_node *node);
 /** returns true if node is a Confirm node. */
@@ -1154,8 +1170,10 @@ int      is_Cond(const ir_node *node);
 int      is_Cmp(const ir_node *node);
 /** returns true if node is an Alloc node */
 int      is_Alloc(const ir_node *node);
-/** returns true if a nide is a Jmp node */
+/** returns true if a node is a Jmp node */
 int      is_Jmp(const ir_node *node);
+/** returns true if a node is a Raise node */
+int      is_Raise(const ir_node *node);
 /** returns true if node is a Proj node or a Filter node in
  * intraprocedural view */
 int      is_Proj(const ir_node *node);
@@ -1187,7 +1205,7 @@ ir_type *get_irn_type(ir_node *n);
 ir_type *get_irn_type_attr(ir_node *n);
 
 /** Return the entity attribute of a node n (SymConst, Sel) or NULL. */
-entity *get_irn_entity_attr(ir_node *n);
+ir_entity *get_irn_entity_attr(ir_node *n);
 
 /** Returns non-zero for constant-like nodes. */
 int is_irn_constlike(const ir_node *node);
@@ -1204,6 +1222,11 @@ int is_irn_always_opt(const ir_node *node);
  */
 int is_irn_keep(const ir_node *node);
 
+/**
+ * Returns non-zero for nodes that are always placed in the start block.
+ */
+int is_irn_start_block_placed(const ir_node *node);
+
 /**
  * Returns non-zero for nodes that are machine operations.
  */