of node cast to long. */
long get_irn_node_nr (const ir_node *node);
-/** Returns the pinned state of a node. */
+/** Returns the pinned state of a node.
+ *
+ * Returns whether the node _always_ must be pinned.
+ * I.e., the node is not floating after global cse.
+ *
+ * @returns Either state op_pin_state_pinned or op_pin_state_floats.
+ */
op_pin_state get_irn_pinned (const ir_node *node);
/** Set pin state for nodes with op pin state op_pin_state_exc_pinned */
void set_irn_pinned(ir_node *node, op_pin_state state);
+/** Returns whether the node is currently pinned.
+ *
+ * If get_irn_pinned returns op_pin_state_floats and the graph the
+ * node belongs to is in state op_poin_state_floats then this function
+ * returns 'floats', else 'pinned'.
+ */
+op_pin_state is_irn_pinned_in_irg (const ir_node *node);
+
/**
* irnode constructor.
* Create a new irnode in irg, with an op, mode, arity and
*
* @param db Debug info.
* @param irg IR-graph on with this new node should be constructed.
+ * @param block The block the new node belongs to
* @param op The opcode of the new node.
* @param mode The mode of the new node.
* @param arity The arity of the new node, may be <0 if yet.
int arity,
ir_node *in[]);
-/** Return the block the node belongs to.
+/**
+ * Return the block the node belongs to. This is only
+ * possible for pinned nodes or if the graph is in pinned state.
+ * Otherwise the block may be incorrect. This condition is
+ * now checked by an assertion.
*
* This works for all except Block. It can return Blocks or the Bad node.
*
* To express the difference to access routines that work for all
* nodes we use infix "nodes" and do not name this function
- * get_irn_block. */
+ * get_irn_block(). */
ir_node *get_nodes_block (const ir_node *node);
/** Sets the Block of a node. */
* @function get_irn_block()
* @see get_nodes_block()
*/
+
/**
* Projection numbers for result of Start node: use for Proj nodes!
*/
int get_Block_n_cfgpreds (ir_node *node);
ir_node *get_Block_cfgpred (ir_node *node, int pos);
void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred);
+/** Get the predecessor block.
+ *
+ * Returns the block corresonding to the predecessor pos of block.
+ *
+ * There are several ambiguities we resolve with this function:
+ * - The direct predecessor can be a Proj, which is not pinned.
+ * We walk from the predecessor to the next pinned node
+ * (skip_Proj) and return the block that node is in.
+ * - If we encounter the Bad node, this function does not return
+ * Start, but the Bad node.
+ */
+ir_node *get_Block_cfgpred_block(ir_node *node, int pos);
bool get_Block_matured (ir_node *node);
void set_Block_matured (ir_node *node, bool matured);
* @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/
unsigned long get_Block_block_visited (ir_node *node);
void set_Block_block_visited (ir_node *node, unsigned long visit);
+
+/**
+ * Marks a block as dead but do not replace it with a Bad node.
+ * Dead blocks are removed in the con
+ */
ir_node *set_Block_dead(ir_node *block);
int is_Block_dead(const ir_node *block);
free_End() frees these data structures. */
void free_End (ir_node *end);
+/** Return the target address of an IJmp */
+ir_node *get_IJmp_target(ir_node *ijmp);
+
+/** Sets the target address of an IJmp */
+void set_IJmp_target(ir_node *ijmp, ir_node *tgt);
/* We distinguish three kinds of Cond nodes. These can be distinguished
by the mode of the selector operand and an internal flag of type cond_kind.
is recognized by the boolean selector.
The switch Cond has as selector an unsigned integer. It produces as result
an n+1 Tuple (cf0, ... , cfn) of control flows.
- We differ two flavours of this Cond. The first, the dense Cond, passes
+ We differ two flavors of this Cond. The first, the dense Cond, passes
control along output i if the selector value is i, 0 <= i <= n. If the
selector value is >n it passes control along output n.
- The second Cond flavor diffirences in the treatment of cases not specified in
+ The second Cond flavor differences in the treatment of cases not specified in
the source program. It magically knows about the existence of Proj nodes.
It only passes control along output i, 0 <= i <= n, if a node Proj(Cond, i)
exists. Else it passes control along output n (even if this Proj does not
CNST_NULL = 0, /**< The node is a const(0). */
CNST_ONE = +1, /**< The node is a const(1). */
CNST_ALL_ONE = -1, /**< The node is a const(11111...). */
- CNST_OTHER = 2, /**< The tarvel of the const has another value. */
+ CNST_OTHER = 2, /**< The tarval of the const has another value. */
CNST_SYMCONST = 3, /**< The node is symconst. */
CNST_NO_CONST = 4 /**< The node is no const at all. */
} cnst_classify_t;
Type_or_id_p is entity *. */
} symconst_kind;
-/** SymConst attributes
- This union contains the symbolic information represented by the node */
+/** SymConst attribute.
+ *
+ * This union contains the symbolic information represented by the node. */
union symconst_symbol {
type *type_p;
ident *ident_p;
pn_Cmp_Uge = pn_Cmp_Uo|pn_Cmp_Eq|pn_Cmp_Gt, /**< unordered, greater or equal */
pn_Cmp_Ne = pn_Cmp_Uo|pn_Cmp_Lt|pn_Cmp_Gt, /**< unordered, less or greater = not equal */
pn_Cmp_True = 15 /**< true */
- /* not_mask = Leg*/ /* bits to flip to negate comparison * @@ hack for jni interface */
+ /* not_mask = Leg*/ /* bits to flip to negate comparison * @@ hack for JNI interface */
} pn_Cmp; /* Projection numbers for Cmp */
/* #define not_mask pn_Cmp_Leg */
const char *get_pnc_string(int pnc);
/** Calculates the negated (Complement(R)) pnc condition. */
-int get_negated_pnc(int pnc);
+int get_negated_pnc(int pnc, ir_mode *mode);
/** Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */
int get_inversed_pnc(int pnc);
* Projection numbers for Alloc: use for Proj nodes!
*/
typedef enum {
- pn_Alloc_M, /**< Memory result. */
+ pn_Alloc_M, /**< Memory result. */
pn_Alloc_X_except, /**< Execution result if exception occurred. */
pn_Alloc_res, /**< Result of allocation. */
pn_Alloc_max /**< number of projections from an Alloc */
ir_node *skip_Proj (ir_node *node);
/** returns operand of node if node is a Id */
ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */
-/* returns corresponding operand of Tuple if node is a Proj from
+/** returns corresponding operand of Tuple if node is a Proj from
a Tuple. */
ir_node *skip_Tuple (ir_node *node);
/** returns operand of node if node is a Cast */