/*
* Creates an exact copy of a node.
- * The copy resists on the sane graph in the same block.
+ * The copy resides in the same graph in the same block.
*/
-ir_node *exact_copy(ir_node *n) {
+ir_node *exact_copy(const ir_node *n) {
ir_graph *irg = get_irn_irg(n);
ir_node *res, *block = NULL;
if (is_no_Block(n))
- block = get_irn_n(n, -1);
+ block = get_nodes_block(n);
res = new_ir_node(get_irn_dbg_info(n),
irg,
* @note If the copy is not changed, the next CSE operation will
* replace it by the original, so beware.
*/
-ir_node *exact_copy(ir_node *n);
+ir_node *exact_copy(const ir_node *n);
#endif /* _FIRM_COMMON_IRTOOLS_H_ */
}
struct dbg_info *
-get_irn_dbg_info(ir_node *n) {
+get_irn_dbg_info(const ir_node *n) {
return n->dbi;
}
/**
* Returns the debug information of an node.
*/
-dbg_info *get_irn_dbg_info(ir_node *n);
+dbg_info *get_irn_dbg_info(const ir_node *n);
/**
* Sets the debug information of an entity.
}
int
-(get_Block_n_cfgpreds)(ir_node *node) {
+(get_Block_n_cfgpreds)(const ir_node *node) {
return _get_Block_n_cfgpreds(node);
}
/* @@@ no more supported */
ir_node **get_Block_cfgpred_arr (ir_node *node);
-int get_Block_n_cfgpreds (ir_node *node);
+int get_Block_n_cfgpreds (const 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.
}
static INLINE int
-_get_Block_n_cfgpreds(ir_node *node) {
+_get_Block_n_cfgpreds(const ir_node *node) {
assert(_is_Block(node));
return _get_irn_arity(node);
}