removed unused data/functions, reformated
[libfirm] / ir / ir / irnode.h
index aaabf5b..43a3bb7 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. */
@@ -519,7 +519,7 @@ typedef enum {
 typedef union symconst_symbol {
   ir_type       *type_p;    /**< the type of a symconst */
   ident         *ident_p;   /**< the ident of a symconst */
-  entity        *entity_p;  /**< the entity 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;
 
@@ -537,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);
@@ -557,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!
@@ -618,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);
@@ -838,6 +838,8 @@ void     set_Cast_type(ir_node *node, ir_type *to_tp);
  *
  * Returns true if the Cast node casts a class type to a super type.
  * Works also for pointers to classes (recursively).
+ *
+ * Needs typeinfo calculated.
  */
 int is_Cast_upcast(ir_node *node);
 
@@ -845,6 +847,8 @@ int is_Cast_upcast(ir_node *node);
  *
  * Returns true if the Cast node casts a class type to a sub type.
  * Works also for pointers to classes (recursively).
+ *
+ * Needs typeinfo calculated.
  */
 int is_Cast_downcast(ir_node *node);
 
@@ -1111,6 +1115,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
@@ -1123,11 +1129,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 */
@@ -1144,6 +1158,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,12 +1170,16 @@ int      is_Pin(const ir_node *node);
 int      is_SymConst(const ir_node *node);
 /** returns true if node is a Cond node. */
 int      is_Cond(const ir_node *node);
+/** returns true of node is a CopyB node */
+int      is_CopyB(const ir_node *node);
 /** returns true if node is a Cmp 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);
@@ -1191,7 +1211,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);
@@ -1208,6 +1228,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.
  */