From e1d0a7c980faef658ffd4fd63a43e74b764a7dfe Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sun, 24 Apr 2011 14:53:34 +0200 Subject: [PATCH] Switch irg index to type size_t, making the API more consistent. --- include/libfirm/irgraph.h | 2 +- include/libfirm/irprog.h | 2 +- ir/ir/irgraph.c | 2 +- ir/ir/irprog.c | 2 +- ir/ir/irprog_t.h | 2 +- ir/ir/irtypes.h | 4 ++-- ir/opt/funccall.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/libfirm/irgraph.h b/include/libfirm/irgraph.h index bfa5c647d..97ecbc0ff 100644 --- a/include/libfirm/irgraph.h +++ b/include/libfirm/irgraph.h @@ -256,7 +256,7 @@ FIRM_API long get_irg_graph_nr(const ir_graph *irg); * smaller than get_irp_last_idx() * Note: you cannot use this number for get_irp_irg() */ -FIRM_API int get_irg_idx(const ir_graph *irg); +FIRM_API size_t get_irg_idx(const ir_graph *irg); /** * Get the node for an index. diff --git a/include/libfirm/irprog.h b/include/libfirm/irprog.h index 752529760..66c695c99 100644 --- a/include/libfirm/irprog.h +++ b/include/libfirm/irprog.h @@ -139,7 +139,7 @@ FIRM_API void remove_irp_irg_from_list(ir_graph *irg); FIRM_API void remove_irp_irg(ir_graph *irg); /** returns the biggest not used irg index number */ -FIRM_API int get_irp_last_idx(void); +FIRM_API size_t get_irp_last_idx(void); /** Returns the number of ir graphs in the irp. */ FIRM_API size_t get_irp_n_irgs(void); diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 6a96a4b19..ba6e16eff 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -494,7 +494,7 @@ long get_irg_graph_nr(const ir_graph *irg) } #endif -int get_irg_idx(const ir_graph *irg) +size_t get_irg_idx(const ir_graph *irg) { return irg->index; } diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index f9779318a..daeb232b9 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -247,7 +247,7 @@ ir_graph *(get_irp_irg)(size_t pos) return _get_irp_irg(pos); } -int get_irp_last_idx(void) +size_t get_irp_last_idx(void) { return irp->max_irg_idx; } diff --git a/ir/ir/irprog_t.h b/ir/ir/irprog_t.h index 00a25970c..7eb4436ca 100644 --- a/ir/ir/irprog_t.h +++ b/ir/ir/irprog_t.h @@ -115,7 +115,7 @@ static inline long get_irp_new_node_nr(void) return irp->max_node_nr++; } -static inline int get_irp_new_irg_idx(void) +static inline size_t get_irp_new_irg_idx(void) { assert(irp); return irp->max_irg_idx++; diff --git a/ir/ir/irtypes.h b/ir/ir/irtypes.h index b887d6d8d..cd3bfcff6 100644 --- a/ir/ir/irtypes.h +++ b/ir/ir/irtypes.h @@ -522,7 +522,7 @@ struct ir_graph { irg_edges_info_t edge_info; /**< edge info for automatic outs */ ir_node **idx_irn_map; /**< Array mapping node indexes to nodes. */ - int index; /**< a unique number for each graph */ + size_t index; /**< a unique number for each graph */ ir_phase *phases[PHASE_LAST+1]; /**< Phase information. */ void *be_data; /**< backend can put in private data here */ @@ -597,7 +597,7 @@ struct ir_prog { ir_exc_region_t last_region_nr; /**< The last exception region number that was assigned. */ ir_label_t last_label_nr; /**< The highest label number for generating unique labels. */ - int max_irg_idx; /**< highest unused irg index */ + size_t max_irg_idx; /**< highest unused irg index */ long max_node_nr; /**< to generate unique numbers for nodes. */ unsigned dump_nr; /**< number of program info dumps */ #ifndef NDEBUG diff --git a/ir/opt/funccall.c b/ir/opt/funccall.c index fe6f8d9d2..7adac2291 100644 --- a/ir/opt/funccall.c +++ b/ir/opt/funccall.c @@ -987,7 +987,7 @@ static void check_for_possible_endless_loops(ir_graph *irg) void optimize_funccalls(void) { size_t i, n; - int last_idx; + size_t last_idx; env_t ctx; size_t num_const = 0; size_t num_pure = 0; -- 2.20.1