/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
* Does not assert whether the backarray is correct -- use
* very careful!
*/
-static bitset_t *mere_get_backarray(ir_node *n)
+static bitset_t *mere_get_backarray(const ir_node *n)
{
switch (get_irn_opcode(n)) {
case iro_Block:
* Returns backarray if the node can have backedges, else returns
* NULL.
*/
-static bitset_t *get_backarray(ir_node *n)
+static bitset_t *get_backarray(const ir_node *n)
{
bitset_t *ba = mere_get_backarray(n);
#ifndef NDEBUG
if (ba) {
- int bal = bitset_size(ba); /* avoid macro expansion in assertion. */
- int inl = get_irn_arity(n);
+ size_t bal = bitset_size(ba); /* avoid macro expansion in assertion. */
+ size_t inl = get_irn_arity(n);
assert(bal == inl && "backedge array with faulty length");
}
#endif
* Returns non-zero if node has no backarray, or
* if size of backarray == size of in array.
*/
-static int legal_backarray(ir_node *n)
+static int legal_backarray(const ir_node *n)
{
bitset_t *ba = mere_get_backarray(n);
if (ba && (bitset_size(ba) != (unsigned) get_irn_arity(n)))
}
/* Returns non-zero if the predecessor pos is a backedge. */
-int is_backedge(ir_node *n, int pos)
+int is_backedge(const ir_node *n, int pos)
{
bitset_t *ba = get_backarray(n);
if (ba)
}
/* Returns non-zero if n has backedges. */
-int has_backedges(ir_node *n)
+int has_backedges(const ir_node *n)
{
bitset_t *ba = get_backarray(n);
if (ba != NULL) {
}
/* Allocate a new backedge array on the obstack for given size. */
-bitset_t *new_backedge_arr(struct obstack *obst, unsigned size)
+bitset_t *new_backedge_arr(struct obstack *obst, size_t size)
{
return bitset_obstack_alloc(obst, size);
}