From: Christoph Mallon Date: Tue, 1 Aug 2006 15:49:01 +0000 (+0000) Subject: Constify X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=aa8b5906d8cb57701b73ac37f932cc1c44dde4c7;p=libfirm Constify [r8098] --- diff --git a/ir/common/irtools.c b/ir/common/irtools.c index 1962b52e8..d307b25e2 100644 --- a/ir/common/irtools.c +++ b/ir/common/irtools.c @@ -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, diff --git a/ir/common/irtools.h b/ir/common/irtools.h index 32b929362..764c06b17 100644 --- a/ir/common/irtools.h +++ b/ir/common/irtools.h @@ -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_ */ diff --git a/ir/debug/dbginfo.c b/ir/debug/dbginfo.c index fb4af7fb5..20ff762d0 100644 --- a/ir/debug/dbginfo.c +++ b/ir/debug/dbginfo.c @@ -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; } diff --git a/ir/debug/dbginfo.h b/ir/debug/dbginfo.h index 1042a48af..39ed3e7fa 100644 --- a/ir/debug/dbginfo.h +++ b/ir/debug/dbginfo.h @@ -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. diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 71171ab01..4efa998b7 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -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); } diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index 48d5f1044..ac7451fff 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -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. diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 55d1174e9..d7afefd82 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -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); }