/*
- * 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.
*
/** Counter to generate depth first numbering of visited nodes. */
static int current_dfn = 1;
-static int max_loop_depth = 0;
+static unsigned max_loop_depth = 0;
void link_to_reg_end(ir_node *n, void *env);
void set_projx_link(ir_node *cb_projx, ir_node *end_projx);
*/
static inline void mark_irn_in_stack(ir_node *n)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
scc->in_stack = 1;
}
*/
static inline void mark_irn_not_in_stack(ir_node *n)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
scc->in_stack = 0;
}
*/
static inline int irn_is_in_stack(ir_node *n)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
return scc->in_stack;
}
*/
static inline void set_irn_uplink(ir_node *n, int uplink)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
scc->uplink = uplink;
}
*/
static int get_irn_uplink(ir_node *n)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
return scc->uplink;
}
*/
static inline void set_irn_dfn(ir_node *n, int dfn)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
scc->dfn = dfn;
}
*/
static int get_irn_dfn(ir_node *n)
{
- scc_info *scc = get_irn_link(n);
+ scc_info *scc = (scc_info*) get_irn_link(n);
assert(scc);
return scc->dfn;
}
/**********************************************************************/
static ir_node **stack = NULL;
-static int tos = 0; /* top of stack */
+static size_t tos = 0; /* top of stack */
/**
* initializes the stack
static inline void push(ir_node *n)
{
if (tos == ARR_LEN(stack)) {
- int nlen = ARR_LEN(stack) * 2;
+ size_t nlen = ARR_LEN(stack) * 2;
ARR_RESIZE(ir_node *, stack, nlen);
}
- stack [tos++] = n;
+ stack[tos++] = n;
mark_irn_in_stack(n);
}
*/
static inline ir_node *pop(void)
{
- ir_node *n = stack[--tos];
+ ir_node *n;
+
+ assert(tos > 0);
+ n = stack[--tos];
mark_irn_not_in_stack(n);
return n;
}
can't they have two loops as sons? Does it never get that far? ) */
static void close_loop(ir_loop *l)
{
- int last = get_loop_n_elements(l) - 1;
+ size_t last = get_loop_n_elements(l) - 1;
loop_element lelement = get_loop_element(l, last);
ir_loop *last_son = lelement.son;
static inline void init_node(ir_node *n, void *env)
{
- struct obstack *obst = env;
+ struct obstack *obst = (struct obstack*) env;
set_irn_link(n, new_scc_info(obst));
clear_backedges(n);
}
void free_all_loop_information(void)
{
- int i;
+ size_t i;
for (i = 0; i < get_irp_n_irgs(); i++) {
free_loop_information(get_irp_irg(i));
}
static int is_loop_variant(ir_loop *l, ir_loop *b)
{
- int i, n_elems;
+ size_t i, n_elems;
if (l == b) return 1;