From: Michael Beck Date: Mon, 6 Apr 2009 12:22:12 +0000 (+0000) Subject: - constify X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=ea6082e224ee6e01961b6902ee41b53aeaa62ed5;p=libfirm - constify - indentation [r25795] --- diff --git a/include/libfirm/irextbb.h b/include/libfirm/irextbb.h index af179d325..d40ff734b 100644 --- a/include/libfirm/irextbb.h +++ b/include/libfirm/irextbb.h @@ -75,7 +75,7 @@ void free_extbb(ir_graph *irg); * * @param node the node */ -ir_extblk *get_nodes_extbb(ir_node *node); +ir_extblk *get_nodes_extbb(const ir_node *node); /** * Gets the visited counter of an extended block. @@ -143,14 +143,14 @@ int get_extbb_n_blocks(const ir_extblk *blk); * @param blk the extended basic block * @param pos the position */ -ir_node *get_extbb_block(ir_extblk *blk, int pos); +ir_node *get_extbb_block(const ir_extblk *blk, int pos); /** * Return the leader basic block of an extended block. * * @param blk the extended basic block */ -ir_node *get_extbb_leader(ir_extblk *blk); +ir_node *get_extbb_leader(const ir_extblk *blk); /** * Return the node number of an extended block. @@ -158,7 +158,7 @@ ir_node *get_extbb_leader(ir_extblk *blk); * * @param blk the extended basic block */ -long get_extbb_node_nr(ir_extblk *blk); +long get_extbb_node_nr(const ir_extblk *blk); /** * Walks only over Extended Basic Block nodes in the graph. diff --git a/ir/ana/irextbb.c b/ir/ana/irextbb.c index 78963d92e..ebc555117 100644 --- a/ir/ana/irextbb.c +++ b/ir/ana/irextbb.c @@ -275,8 +275,8 @@ void free_extbb(ir_graph *irg) { } /* Return the extended block of a node. */ -ir_extblk *get_nodes_extbb(ir_node *node) { - ir_node *block = is_Block(node) ? node : get_irn_n(node, -1); +ir_extblk *get_nodes_extbb(const ir_node *node) { + const ir_node *block = is_Block(node) ? node : get_nodes_block(node); return get_Block_extbb(block); } @@ -321,17 +321,17 @@ int (get_extbb_n_blocks)(const ir_extblk *blk) { } /* Return the i'th basic block of an extended block */ -ir_node *(get_extbb_block)(ir_extblk *blk, int pos) { +ir_node *(get_extbb_block)(const ir_extblk *blk, int pos) { return _get_extbb_block(blk, pos); } /* Return the leader basis block of an extended block. */ -ir_node *(get_extbb_leader)(ir_extblk *blk) { +ir_node *(get_extbb_leader)(const ir_extblk *blk) { return _get_extbb_leader(blk); } /* Return the node number of an extended block. */ -long get_extbb_node_nr(ir_extblk *blk) { +long get_extbb_node_nr(const ir_extblk *blk) { return get_irn_node_nr(get_extbb_leader(blk)); } diff --git a/ir/ana/irextbb_t.h b/ir/ana/irextbb_t.h index 0514e3033..00daa8dc0 100644 --- a/ir/ana/irextbb_t.h +++ b/ir/ana/irextbb_t.h @@ -35,10 +35,10 @@ * An extended block. */ struct _ir_extblk { - firm_kind kind; /**< k_ir_extblk */ - ir_visited_t visited; /**< visited flag */ - ir_node **blks; /**< blocks belonging to this extended block */ - void *link; /**< private link field */ + firm_kind kind; /**< k_ir_extblk */ + ir_visited_t visited; /**< visited flag */ + ir_node **blks; /**< blocks belonging to this extended block */ + void *link; /**< private link field */ }; /** @@ -46,8 +46,8 @@ struct _ir_extblk { * Intern version for libFirm. */ static inline int -_is_ir_extbb (const void *thing) { - return (get_kind(thing) == k_ir_extblk); +_is_ir_extbb(const void *thing) { + return (get_kind(thing) == k_ir_extblk); } /** @@ -56,8 +56,8 @@ _is_ir_extbb (const void *thing) { */ static inline ir_visited_t _get_extbb_visited(const ir_extblk *blk) { - assert(blk); - return blk->visited; + assert(blk); + return blk->visited; } /** @@ -66,8 +66,8 @@ _get_extbb_visited(const ir_extblk *blk) { */ static inline void _set_extbb_visited(ir_extblk *blk, ir_visited_t visited) { - assert(blk); - blk->visited = visited; + assert(blk); + blk->visited = visited; } /** @@ -76,8 +76,8 @@ _set_extbb_visited(ir_extblk *blk, ir_visited_t visited) { */ static inline void _mark_extbb_visited(ir_extblk *blk) { - assert(blk); - blk->visited = current_ir_graph->block_visited; + assert(blk); + blk->visited = current_ir_graph->block_visited; } /** @@ -86,8 +86,8 @@ _mark_extbb_visited(ir_extblk *blk) { */ static inline int _extbb_visited(const ir_extblk *blk) { - assert(blk); - return blk->visited >= current_ir_graph->block_visited; + assert(blk); + return blk->visited >= current_ir_graph->block_visited; } /** @@ -96,8 +96,8 @@ _extbb_visited(const ir_extblk *blk) { */ static inline int _extbb_not_visited(const ir_extblk *blk) { - assert(blk); - return blk->visited < current_ir_graph->block_visited; + assert(blk); + return blk->visited < current_ir_graph->block_visited; } /** @@ -106,8 +106,8 @@ _extbb_not_visited(const ir_extblk *blk) { */ static inline void * _get_extbb_link(const ir_extblk *blk) { - assert(blk); - return blk->link; + assert(blk); + return blk->link; } /** @@ -116,8 +116,8 @@ _get_extbb_link(const ir_extblk *blk) { */ static inline void _set_extbb_link(ir_extblk *blk, void *link) { - assert(blk); - blk->link = link; + assert(blk); + blk->link = link; } /** @@ -125,27 +125,27 @@ _set_extbb_link(ir_extblk *blk, void *link) { */ static inline int _get_extbb_n_blocks(const ir_extblk *blk) { - assert(blk); - return ARR_LEN(blk->blks); + assert(blk); + return ARR_LEN(blk->blks); } /** * Return the i'th basis block of an extended block */ static inline ir_node * -_get_extbb_block(ir_extblk *blk, int pos) +_get_extbb_block(const ir_extblk *blk, int pos) { - assert(blk && 0 <= pos && pos < _get_extbb_n_blocks(blk)); - return blk->blks[pos]; + assert(blk && 0 <= pos && pos < _get_extbb_n_blocks(blk)); + return blk->blks[pos]; } /** * Return the leader basis block of an extended block */ static inline ir_node * -_get_extbb_leader(ir_extblk *blk) +_get_extbb_leader(const ir_extblk *blk) { - return blk->blks[0]; + return blk->blks[0]; } #define is_ir_extbb(thing) _is_ir_extbb(thing)