* @date 5.2005
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
#include "irextbb_t.h"
#include "irgwalk.h"
#include "xmalloc.h"
#include "irprintf.h"
+/**
+ * Environment for extbb construction.
+ */
typedef struct _env {
struct obstack *obst; /**< the obstack where allocations took place */
ir_extblk *head; /**< head of the list of all extended blocks */
}
/* 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);
}
}
/* 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));
}