Switch irg index to type size_t, making the API more consistent.
authorMichael Beck <mm.beck@gmx.net>
Sun, 24 Apr 2011 12:53:34 +0000 (14:53 +0200)
committerMichael Beck <mm.beck@gmx.net>
Sun, 24 Apr 2011 14:04:36 +0000 (16:04 +0200)
include/libfirm/irgraph.h
include/libfirm/irprog.h
ir/ir/irgraph.c
ir/ir/irprog.c
ir/ir/irprog_t.h
ir/ir/irtypes.h
ir/opt/funccall.c

index bfa5c64..97ecbc0 100644 (file)
@@ -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.
index 7525297..66c695c 100644 (file)
@@ -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);
index 6a96a4b..ba6e16e 100644 (file)
@@ -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;
 }
index f977931..daeb232 100644 (file)
@@ -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;
 }
index 00a2597..7eb4436 100644 (file)
@@ -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++;
index b887d6d..cd3bfcf 100644 (file)
@@ -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
index fe6f8d9..7adac22 100644 (file)
@@ -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;