Author: chromatic
Date: Sat Jul 19 16:20:07 2008
New Revision: 29616

Modified:
   trunk/compilers/imcc/cfg.c
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/symreg.c
   trunk/compilers/imcc/unit.h

Log:
[IMCC] Cleaned up more of IMCC's register allocator -- again, there should be
no functional changes.

Modified: trunk/compilers/imcc/cfg.c
==============================================================================
--- trunk/compilers/imcc/cfg.c  (original)
+++ trunk/compilers/imcc/cfg.c  Sat Jul 19 16:20:07 2008
@@ -43,7 +43,7 @@
         FUNC_MODIFIES(*r);
 
 static void analyse_life_symbol(
-    ARGIN(const struct _IMC_Unit *unit),
+    ARGIN(const IMC_Unit *unit),
     ARGMOD(SymReg* r))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
@@ -204,7 +204,7 @@
 */
 
 void
-find_basic_blocks(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit), int first)
+find_basic_blocks(PARROT_INTERP, ARGMOD(IMC_Unit *unit), int first)
 {
     Basic_block          *bb;
     Instruction          *ins;
@@ -350,11 +350,10 @@
 */
 
 void
-build_cfg(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit))
+build_cfg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
     Basic_block *last = NULL;
-    unsigned int i;
-    int          changes;
+    int i, changes;
 
     IMCC_info(interp, 2, "build_cfg\n");
 
@@ -394,7 +393,7 @@
              * s. #25948
              */
             if (!bb->pred_list) {
-                unsigned int j;
+                int j;
 
                 for (j = i; j < unit->n_basic_blocks; j++) {
                     Basic_block * const b_bsr = unit->bb_list[j];
@@ -456,7 +455,7 @@
     /* Decouple unreachable blocks (not the first block, with no predecessors)
      * from the CFG */
     do {
-        unsigned int i;
+        int i;
         changes = 0;
 
         for (i = 1; i < unit->n_basic_blocks; i++) {
@@ -681,7 +680,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 int
-edge_count(ARGIN(const struct _IMC_Unit *unit))
+edge_count(ARGIN(const IMC_Unit *unit))
 {
     Edge *e = unit->edge_list;
     int   i = 0;
@@ -707,7 +706,7 @@
 */
 
 void
-life_analysis(PARROT_INTERP, ARGIN(const struct _IMC_Unit *unit))
+life_analysis(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
 {
     SymReg  ** const reglist = unit->reglist;
     int              i;
@@ -730,9 +729,9 @@
 */
 
 static void
-analyse_life_symbol(ARGIN(const struct _IMC_Unit *unit), ARGMOD(SymReg* r))
+analyse_life_symbol(ARGIN(const IMC_Unit *unit), ARGMOD(SymReg* r))
 {
-    unsigned int i;
+    int i;
 
 #if IMC_TRACE_HIGH
     fprintf(stderr, "cfg.c: analyse_life_symbol(%s)\n", r->name);
@@ -792,13 +791,13 @@
 */
 
 void
-free_life_info(ARGIN(const struct _IMC_Unit *unit), ARGMOD(SymReg *r))
+free_life_info(ARGIN(const IMC_Unit *unit), ARGMOD(SymReg *r))
 {
 #if IMC_TRACE_HIGH
     fprintf(stderr, "free_life_into(%s)\n", r->name);
 #endif
     if (r->life_info) {
-        unsigned int i;
+        int i;
 
         for (i = 0; i < unit->n_basic_blocks; i++) {
             mem_sys_free(r->life_info[i]);
@@ -970,7 +969,7 @@
 */
 
 void
-compute_dominators(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit))
+compute_dominators(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
 #define USE_BFS 0
 
@@ -1107,7 +1106,7 @@
 */
 
 void
-compute_dominance_frontiers(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit))
+compute_dominance_frontiers(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
     int i, b;
 
@@ -1194,7 +1193,7 @@
 free_dominance_frontiers(ARGMOD(IMC_Unit *unit))
 {
     if (unit->dominance_frontiers) {
-        unsigned int i;
+        int i;
 
         for (i = 0; i < unit->n_basic_blocks; i++) {
             set_free(unit->dominance_frontiers[i]);
@@ -1222,7 +1221,7 @@
 
     Loop_info   *li;
     Loop_info  **loop_info = unit->loop_info;
-    unsigned int n_loops   = (unsigned int)unit->n_loops;
+    int          n_loops   = (int)unit->n_loops;
     int          i, j, changed;
 
     for (i = 0; i < n_loops; i++) {
@@ -1296,9 +1295,9 @@
 */
 
 void
-find_loops(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit))
+find_loops(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
-    unsigned int i;
+    int i;
 
     IMCC_info(interp, 2, "find_loops\n");
 
@@ -1333,7 +1332,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 int
-natural_preheader(ARGIN(const struct _IMC_Unit *unit), ARGIN(const Loop_info* 
loop_info))
+natural_preheader(ARGIN(const IMC_Unit *unit), ARGIN(const Loop_info* 
loop_info))
 {
     Edge *edge;
     int   preheader = -1;

Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c (original)
+++ trunk/compilers/imcc/instructions.c Sat Jul 19 16:20:07 2008
@@ -399,7 +399,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 Instruction *
-_delete_ins(ARGMOD(struct _IMC_Unit *unit), ARGIN(Instruction *ins))
+_delete_ins(ARGMOD(IMC_Unit *unit), ARGIN(Instruction *ins))
 {
     Instruction * const next = ins->next;
     Instruction * const prev = ins->prev;
@@ -432,7 +432,7 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 Instruction *
-delete_ins(ARGMOD(struct _IMC_Unit *unit), ARGMOD(Instruction *ins))
+delete_ins(ARGMOD(IMC_Unit *unit), ARGMOD(Instruction *ins))
 {
     Instruction * next = _delete_ins(unit, ins);
 
@@ -452,7 +452,7 @@
 */
 
 void
-insert_ins(ARGMOD(struct _IMC_Unit *unit), ARGMOD_NULLOK(Instruction *ins),
+insert_ins(ARGMOD(IMC_Unit *unit), ARGMOD_NULLOK(Instruction *ins),
         ARGMOD(Instruction *tmp))
 {
     if (!ins) {
@@ -497,7 +497,7 @@
 */
 
 void
-prepend_ins(ARGMOD(struct _IMC_Unit *unit), ARGMOD_NULLOK(Instruction *ins),
+prepend_ins(ARGMOD(IMC_Unit *unit), ARGMOD_NULLOK(Instruction *ins),
         ARGMOD(Instruction *tmp))
 {
     if (!ins) {
@@ -534,7 +534,7 @@
 */
 
 void
-subst_ins(ARGMOD(struct _IMC_Unit *unit), ARGMOD(Instruction *ins),
+subst_ins(ARGMOD(IMC_Unit *unit), ARGMOD(Instruction *ins),
           ARGMOD(Instruction *tmp), int needs_freeing)
 {
     Instruction * const prev = ins->prev;
@@ -573,7 +573,7 @@
 
 PARROT_CAN_RETURN_NULL
 Instruction *
-move_ins(ARGMOD(struct _IMC_Unit *unit), ARGMOD(Instruction *ins), 
ARGMOD(Instruction *to))
+move_ins(ARGMOD(IMC_Unit *unit), ARGMOD(Instruction *ins), ARGMOD(Instruction 
*to))
 {
     Instruction * const next = _delete_ins(unit, ins);
     insert_ins(unit, to, ins);
@@ -593,7 +593,7 @@
 
 PARROT_CAN_RETURN_NULL
 Instruction *
-emitb(PARROT_INTERP, ARGMOD_NULLOK(struct _IMC_Unit *unit), 
ARGIN_NULLOK(Instruction *i))
+emitb(PARROT_INTERP, ARGMOD_NULLOK(IMC_Unit *unit), ARGIN_NULLOK(Instruction 
*i))
 {
 
     if (!unit || !i)
@@ -859,7 +859,7 @@
 
 PARROT_API
 int
-emit_flush(PARROT_INTERP, ARGIN_NULLOK(void *param), ARGIN(struct _IMC_Unit 
*unit))
+emit_flush(PARROT_INTERP, ARGIN_NULLOK(void *param), ARGIN(IMC_Unit *unit))
 {
     Instruction * ins;
 

Modified: trunk/compilers/imcc/symreg.c
==============================================================================
--- trunk/compilers/imcc/symreg.c       (original)
+++ trunk/compilers/imcc/symreg.c       Sat Jul 19 16:20:07 2008
@@ -329,7 +329,7 @@
 */
 
 void
-add_namespace(PARROT_INTERP, ARGMOD(struct _IMC_Unit *unit))
+add_namespace(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
 {
     SymReg * const ns = IMCC_INFO(interp)->cur_namespace;
 
@@ -1445,7 +1445,7 @@
 */
 
 void
-clear_locals(ARGIN_NULLOK(struct _IMC_Unit *unit))
+clear_locals(ARGIN_NULLOK(IMC_Unit *unit))
 {
     SymHash * const hsh = &unit->hash;
     int i;

Modified: trunk/compilers/imcc/unit.h
==============================================================================
--- trunk/compilers/imcc/unit.h (original)
+++ trunk/compilers/imcc/unit.h Sat Jul 19 16:20:07 2008
@@ -38,7 +38,7 @@
     Instruction      *last_ins;
     SymHash           hash;
     int               bb_list_size;
-    unsigned int      n_basic_blocks;
+    int               n_basic_blocks;
     Basic_block     **bb_list;
     Set             **dominators;
     int              *idoms;

Reply via email to