/*
- * 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.
*
/* Computing x * _FIRM_FNV_FNV_PRIME */
#define _FIRM_FNV_TIMES_PRIME(x) ((x) * _FIRM_FNV_FNV_PRIME)
-static inline unsigned firm_fnv_hash(const unsigned char *data, unsigned bytes)
+static inline unsigned firm_fnv_hash(const unsigned char *data, size_t bytes)
{
- unsigned i;
+ size_t i;
unsigned hash = _FIRM_FNV_OFFSET_BASIS;
for(i = 0; i < bytes; ++i) {
/*
- * 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.
*
#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
bitset_t *uses = bitset_alloca(lv->n_blocks);
bitset_t *Tq;
- unsigned i, min_dom, max_dom;
+ size_t i;
+ unsigned min_dom, max_dom;
const ir_edge_t *edge;
/* if the block has no DFS info, it cannot be reached.
/*
- * 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.
*
admissible_colors(env, ni, bs);
if (bitset_popcount(bs) == 1) {
- unsigned c = bitset_next_set(bs, 0);
+ size_t c = bitset_next_set(bs, 0);
badness[c] += ci->costs;
}
{
unsigned n_regs = co->cls->n_regs;
bitset_t *allocatable_regs = bitset_alloca(n_regs);
- unsigned i, j, k;
+ unsigned i, j;
+ size_t k;
ir_node *irn;
co_mst_env_t mst_env;
/*
- * 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.
*
be_lv_t *lv = be_get_irg_liveness(irg);
ir_nodeset_t live_nodes;
ir_node *irn;
- int max_live;
+ size_t max_live;
DBG((dbg, LEVEL_1, "Processing Block %+F\n", block));
max_live = ir_nodeset_size(&live_nodes);
sched_foreach_reverse(block, irn) {
- int cnt;
+ size_t cnt;
if (is_Phi(irn))
break;
max_live = MAX(cnt, max_live);
}
- DBG((dbg, LEVEL_1, "Finished with Block %+F (%s %u)\n", block, cls->name, max_live));
+ DBG((dbg, LEVEL_1, "Finished with Block %+F (%s %zu)\n", block, cls->name, max_live));
ir_nodeset_destroy(&live_nodes);
return max_live;
/*
- * 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.
*
/* for all */
foreach_ir_nodemap(&cenv.op_set, map_entry, map_iter) {
op_copy_assoc_t *entry = (op_copy_assoc_t*)map_entry.data;
- int n = ir_nodeset_size(&entry->copies);
+ size_t n = ir_nodeset_size(&entry->copies);
ir_node **nodes = ALLOCAN(ir_node*, n);
ir_node *cp;
ir_nodeset_iterator_t iter;
/*
- * 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.
*
{
ir_nodeset_iterator_t iter;
unsigned r;
- unsigned n_allowed;
+ size_t n_allowed;
allocation_info_t *info = get_allocation_info(node);
ir_node *neighbor;
/*
- * 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.
*
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static spill_env_t *spill_env;
-static int n_regs;
+static unsigned n_regs;
static const arch_register_class_t *cls;
static const be_lv_t *lv;
static bitset_t *spilled_nodes;
size_t free_regs_needed = 0;
spill_candidate_t *candidates;
ir_nodeset_iterator_t iter;
- size_t i, arity;
+ int i, arity;
int spills_needed;
size_t cand_idx;
ir_node *n;
/*
- * 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.
*
be_lv_t *lv;
double insn_count;
double regpressure;
- int max_pressure;
+ size_t max_pressure;
const arch_register_class_t *cls;
};
ir_graph *irg = env->irg;
ir_node *irn;
ir_nodeset_t live_nodes;
- int max_live;
+ size_t max_live;
ir_nodeset_init(&live_nodes);
be_liveness_end_of_block(env->lv, cls, block, &live_nodes);
env->regpressure += max_live;
sched_foreach_reverse(block, irn) {
- int cnt;
+ size_t cnt;
if (is_Phi(irn))
break;
/*
- * 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.
*
ir_node *mem = get_Store_mem(node);
dbg_info *dbgi = get_irn_dbg_info(node);
int ofs = 0;
- size_t i = 0;
+ int i = 0;
ir_node *ins[4];
ia32_address_t addr;
/*
- * 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.
*
static int get_conv_costs(const ir_node *node, ir_mode *dest_mode)
{
ir_mode *mode = get_irn_mode(node);
- size_t arity;
- size_t i;
+ int arity;
+ int i;
int costs;
if (mode == dest_mode)
/* Take the minimum of the conversion costs for Phi predecessors as only one
* branch is actually executed at a time */
if (is_Phi(node)) {
- size_t i;
- size_t arity = get_Phi_n_preds(node);
+ int i;
+ int arity = get_Phi_n_preds(node);
int costs;
costs = get_conv_costs(get_Phi_pred(node, 0), dest_mode);
{
ir_mode *mode = get_irn_mode(node);
ir_graph *irg = get_irn_irg(node);
- size_t arity;
- size_t conv_arity;
- size_t i;
+ int arity;
+ int conv_arity;
+ int i;
ir_node *new_node;
ir_node **ins;
/*
- * 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.
*
}
/* returns the attribute size of the operator. */
-int (get_tpop_attr_size)(const tp_op *op)
+size_t (get_tpop_attr_size)(const tp_op *op)
{
return _get_tpop_attr_size(op);
}
/*
- * 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.
*
* @param op The type opcode to get the size for.
* @return The size of the attribute of types with this opcode.
*/
-int get_tpop_attr_size (const tp_op *op);
+size_t get_tpop_attr_size(const tp_op *op);
/* ---------------- *
/*
- * 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.
*
ir_type *new_type(const tp_op *type_op, ir_mode *mode, type_dbg_info *db)
{
ir_type *res;
- int node_size;
+ size_t node_size;
node_size = offsetof(ir_type, attr) + type_op->attr_size;
res = (ir_type*)xmalloc(node_size);
/*
- * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
return calc_buffer_size;
}
-void *fc_val_from_str(const char *str, unsigned int len, const ieee_descriptor_t *desc, void *result)
+void *fc_val_from_str(const char *str, size_t len, const ieee_descriptor_t *desc, void *result)
{
char *buffer;
/*
- * 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.
*
int fc_get_buffer_length(void);
/*}@*/
-void *fc_val_from_str(const char *str, unsigned int len, const ieee_descriptor_t *desc, void *result);
+void *fc_val_from_str(const char *str, size_t len, const ieee_descriptor_t *desc, void *result);
/** get the representation of a floating point value
* This function tries to builds a representation having the same value as the
/*
- * 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.
*
}
int sc_val_from_str(char sign, unsigned base, const char *str,
- unsigned int len, void *buffer)
+ size_t len, void *buffer)
{
char *sc_base, *val;
/*
- * 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.
*
* @return 1 if ok, 0 in case of parse error
*/
int sc_val_from_str(char sign, unsigned base, const char *str,
- unsigned int len, void *buffer);
+ size_t len, void *buffer);
/** create a value from a long */
void sc_val_from_long(long l, void *buffer);