Constify
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 1 Aug 2006 15:49:01 +0000 (15:49 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 1 Aug 2006 15:49:01 +0000 (15:49 +0000)
[r8098]

ir/common/irtools.c
ir/common/irtools.h
ir/debug/dbginfo.c
ir/debug/dbginfo.h
ir/ir/irnode.c
ir/ir/irnode.h
ir/ir/irnode_t.h

index 1962b52..d307b25 100644 (file)
@@ -96,14 +96,14 @@ copy_irn_to_irg(ir_node *n, ir_graph *irg)
 
 /*
  * 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,
index 32b9293..764c06b 100644 (file)
@@ -72,6 +72,6 @@ void copy_irn_to_irg(ir_node *n, ir_graph *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_ */
index fb4af7f..20ff762 100644 (file)
@@ -50,7 +50,7 @@ set_irn_dbg_info(ir_node *n, struct dbg_info* db) {
 }
 
 struct dbg_info *
-get_irn_dbg_info(ir_node *n) {
+get_irn_dbg_info(const ir_node *n) {
   return n->dbi;
 }
 
index 1042a48..39ed3e7 100644 (file)
@@ -60,7 +60,7 @@ void set_irn_dbg_info(ir_node *n, dbg_info *db);
 /**
  * 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.
index 71171ab..4efa998 100644 (file)
@@ -647,7 +647,7 @@ get_Block_cfgpred_arr (ir_node *node)
 }
 
 int
-(get_Block_n_cfgpreds)(ir_node *node) {
+(get_Block_n_cfgpreds)(const ir_node *node) {
   return _get_Block_n_cfgpreds(node);
 }
 
index 48d5f10..ac7451f 100644 (file)
@@ -282,7 +282,7 @@ int   is_value_arg_pointer(ir_node *n);
 
 /* @@@ 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.
index 55d1174..d7afefd 100644 (file)
@@ -663,7 +663,7 @@ _is_Block(const ir_node *node) {
 }
 
 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);
 }