*** empty log message ***
authorChristian Schäfer <schaefer@ipd.info.uni-karlsruhe.de>
Wed, 31 May 2000 11:44:16 +0000 (11:44 +0000)
committerChristian Schäfer <schaefer@ipd.info.uni-karlsruhe.de>
Wed, 31 May 2000 11:44:16 +0000 (11:44 +0000)
[r11]

ir/common/firm.c
ir/common/firm.h
ir/ident/ident.c
ir/ir/ircons.c
ir/ir/irdump.c
ir/ir/iropt.c
ir/tr/entity.h
ir/tr/type.h
ir/tv/tv.h

index 18e3e3b..82ef6aa 100644 (file)
 void
 init_firm (void)
 {
+  /* register the character 'I' as variable for ident outputs. */
   xprintf_register ('I', ident_print);
+  /* register the character 'v' as variable for tarval outputs. */
   xprintf_register ('v', tarval_print);
+  /* register the character 'R' as variable for ir node outputs. */
   xprintf_register ('R', ir_node_print);
+  /* initialize all ident stuff */
   id_init ();
+  /* create an obstack and put alle tarvals in a pdeq */
   tarval_init_1 ();
+  /* initialize all modes an ir node can consist of */
   init_mode ();
+  /* initialize tarvals, and floating point arithmetic */
   tarval_init_2 ();
+  /* kind of obstack initialization */
   init_mangle ();
+  /* initalize all op codes an irnode can consist of */
   init_op ();
+  /* called once for each run of this library, empty at this moment!!! */
   init_cons ();
 }
index 088d4c7..add3710 100644 (file)
@@ -3,7 +3,7 @@
 **
 ** Authors: Martin Trapp, Christian Schaefer
 **
-** firm.h:
+** firm.h: initialize the firm tree with all its components
 */
 
 # ifndef _FIRM_H_
index 6b46413..e01d0b7 100644 (file)
@@ -16,7 +16,6 @@
 
 #define XX_USER(name) ident *id_##name;
 #define XX_INTERNAL(name, str) XX_USER(name)
-//#include "xx_ident.h"
 #undef XX_USER
 #undef XX_INTERNAL
 
@@ -91,7 +90,6 @@ id_init (void)
 
 #define XX_USER(name) id_##name = ID_FROM_STR(#name, sizeof(#name)- 1);
 #define XX_INTERNAL(name, str) id_##name = ID_FROM_STR((str), sizeof((str))-1);
-  //#include "xx_ident.h"
 #undef XX_USER
 #undef XX_INTERNAL
 }
index 4d07570..7c47697 100644 (file)
@@ -742,7 +742,8 @@ new_Block (void)
   res->attr.block.matured = 0;
   set_Block_block_visit(res, 0);
 
-  // res = optimize (res); /* GL: only optimize if mature!!!! */
+  /* forget this optimization. use this only if mature !!!!
+  res = optimize (res); */
   ir_vrfy (res);
 
   /** create a new dynamic array, which stores all parameters in irnodes */
index c37eb0e..08a4ebd 100644 (file)
@@ -173,17 +173,19 @@ dump_ir_node (ir_node *n)
     assert(n->attr.s.ent->kind == k_entity);
     xfprintf (F, "\"%I ", n->op->name);
     xfprintf (F, "%s\" ", id_to_str(n->attr.s.ent->name));
-    // xfprintf (F, "\"%I %I\" ", n->op->name, n->attr.s.ent); // GL: doesn't work for some reason.
+    /*  xdoesn't work for some reason.
+       fprintf (F, "\"%I %I\" ", n->op->name, n->attr.s.ent); */
     xfprintf (F, DEFAULT_NODE_ATTR);
     break;
   case iro_SymConst:
     assert(get_kind(get_SymConst_type(n)) == k_type_class);
-      //assert(n->attr.i.type->kind == k_type_class);
+    /* assert(n->attr.i.type->kind == k_type_class); */
     assert(get_class_ident((type_class *)get_SymConst_type(n)));
-    //assert(n->attr.i.type->clss->name);
+    /* assert(n->attr.i.type->clss->name); */
     xfprintf (F, "\"%s ", id_to_str(get_class_ident((type_class *)get_SymConst_type(n))));
-    //xfprintf (F, "\"%s ", id_to_str(n->attr.i.type->name));
-    // xfprintf (F, "\"%N\" ", n->attr.i.type);  // GL: doesn't work for some reason.
+    /* xfprintf (F, "\"%s ", id_to_str(n->attr.i.type->name)); */
+    /* doesn't work for some reason. */
+    /* xfprintf (F, "\"%N\" ", n->attr.i.type); */
     switch (n->attr.i.num){
     case type_tag:
       xfprintf (F, "tag\" ");
@@ -541,7 +543,7 @@ dump_ir_graph_w_types (ir_graph *irg)
   vcg_open (irg, "-all");
 
   /* dump common ir graph */
-  //  irg_block_walk(irg->end, dump_ir_block, NULL, irg);
+  /*  irg_block_walk(irg->end, dump_ir_block, NULL, irg); */
   irg_walk(irg->end, dump_whole_node, NULL, NULL);
   /* dump type info */
   type_walk(irg, dump_type_info, NULL, NULL);
index 99e8322..68221c9 100644 (file)
@@ -190,7 +190,7 @@ computed_value (ir_node *n)
          }
        }
       } else {
-        // printf(" # comp_val: Proj node, not optimized\n");
+        /* printf(" # comp_val: Proj node, not optimized\n"); */
       }
     }
     break;
@@ -392,7 +392,7 @@ equivalent_node (ir_node *n)
       }
 
       if (n_preds == 0) {      /* Phi of dead Region without predecessors. */
-        // GL: why not return new_Bad?
+        /* GL: why not return new_Bad? */
        break;
       }
 
@@ -733,7 +733,7 @@ vt_cmp (const void *elt, const void *key)
     return 1;
 
   /* compare a->in[0..ins] with b->in[0..ins], i.e., include the block. */
-  // do if (*ain++ != *bin++) return 1; while (ins--);
+  /* do if (*ain++ != *bin++) return 1; while (ins--); */
   for (i = -1; i < get_irn_arity(a); i++)
     if (get_irn_n(a, i) != get_irn_n(b, i))
       return 1;
@@ -776,17 +776,17 @@ ir_node_hash (ir_node *node)
   unsigned h;
   int i;
 
-  // hash table value = 9*(9*(9*(9*(9*arity+in[0])+in[1])+ ...)+mode)+code
+  /* hash table value = 9*(9*(9*(9*(9*arity+in[0])+in[1])+ ...)+mode)+code */
   h = get_irn_arity(node);
 
-  // consider all in nodes... except the block.
+  /* consider all in nodes... except the block. */
   for (i = 0;  i < get_irn_arity(node);  i++) {
     h = 9*h + (unsigned long)get_irn_n(node, i);
   }
 
-  // ...mode,...
+  /* ...mode,... */
   h = 9*h + (unsigned long) get_irn_mode (node);
-  // ...and code
+  /* ...and code */
   h = 9*h + (unsigned long) get_irn_op (node);
 
   return h;
@@ -901,7 +901,7 @@ optimize (ir_node *n)
         /* evaluation was succesful -- replace the node. */
        obstack_free (current_ir_graph->obst, n);
        return new_Const (get_tv_mode (tv), tv);
-        // xprintf("* optimize: computed node %I\n", n->op->name);
+        /* xprintf("* optimize: computed node %I\n", n->op->name); */
       }
     }
   }
@@ -921,7 +921,7 @@ optimize (ir_node *n)
   /* identify found a cse, so deallocate the old node. */
   if (n != old_n) {
     obstack_free (current_ir_graph->obst, old_n);
-    // The AmRoq fiasco returns n here.  Martin's version doesn't.
+    /* The AmRoq fiasco returns n here.  Martin's version doesn't. */
   }
 
 #if 0
@@ -937,12 +937,12 @@ optimize (ir_node *n)
 
   /* Now we have a legal, useful node. Enter it in hash table for cse */
   if (get_opt_cse()) {
-    // aborts ??! set/pset can not handle several hash tables??!
-    // No, suddenly it works.
+    /* aborts ??! set/pset can not handle several hash tables??!
+       No, suddenly it works. */
     n = identify_remember (current_ir_graph->value_table, n);
   }
 
-#if 0  // GL: what's the use of this??
+#if 0  /* GL: what's the use of this?? */
   if ((current_ir_graph->state & irgs_building) && IR_KEEP_ALIVE (n)) {
     assert (~current_ir_graph->state & irgs_keep_alives_in_arr);
     pdeq_putr (current_ir_graph->keep.living, n);
@@ -965,7 +965,7 @@ optimize_in_place (ir_node *n)
 
   /* if not optimize return n */
   if (n == NULL) {
-    // Here this is possible.  Why?
+    /* Here this is possible.  Why? */
     return n;
   }
 
@@ -978,7 +978,7 @@ optimize_in_place (ir_node *n)
       if (tv != NULL) {
         /* evaluation was succesful -- replace the node. */
        return new_Const (get_tv_mode (tv), tv);
-        // xprintf("* optimize: computed node %I\n", n->op->name);
+        /* xprintf("* optimize: computed node %I\n", n->op->name);*/
       }
     }
   }
@@ -997,7 +997,7 @@ optimize_in_place (ir_node *n)
 
   /* identify found a cse, so deallocate the old node. */
   if (n != old_n) {
-    // The AmRoq fiasco returns n here.  Martin's version doesn't.
+    /* The AmRoq fiasco returns n here.  Martin's version doesn't. */
   }
 
 #if 0
@@ -1013,8 +1013,8 @@ optimize_in_place (ir_node *n)
 
   /* Now we have a legal, useful node. Enter it in hash table for cse */
   if (get_opt_cse()) {
-    // aborts ??! set/pset can not handle several hash tables??!
-    // No, suddenly it works.
+    /* aborts ??! set/pset can not handle several hash tables??!
+       No, suddenly it works. */
     n = identify_remember (current_ir_graph->value_table, n);
   }
 
index 57d9e98..992935c 100644 (file)
@@ -30,7 +30,9 @@ typedef struct entity {
   ident *name;          /* name of this entity */
   // type_class *owner;    /* The class this entity belongs to */
   type *owner;          /* The class this entity belongs to */
-  ident *ld_name;       // don't know what this is good for.
+  ident *ld_name;       /* Unique name of this entity, i.e., the mangled
+                           name.  E.g., for a class `A' with field `a' this
+                           is the ident for `A_a'. */
   type *type;           /* The type of this entity, e.g., a method type, a
                            basic type of the language or a class itself */
   unsigned long visit;  /* visited counter for walks of the type information */
index 88c2646..18f7254 100644 (file)
@@ -79,14 +79,15 @@ void   set_strct_ident (type_strct *strct, ident* ident);
 
 typedef struct {
   firm_kind kind;
-  ident *name;     // do I need the name, or is the name in entity sufficient?
-  int arity;                   /* number of parameters, better n_params */
-  type **param_type;     /* code generation needs this information.
-                                  Should it be generated by the frontend,
-                                  or does this impose unnecessary work for
-                                  optimizatinos that change the parameters of
-                                  methods? */
-  int n_res;                   /* number of results */
+  ident *name;         /* do I need the name,
+                         or is the name in entity sufficient? */
+  int arity;           /* number of parameters, better n_params */
+  type **param_type;   /* code generation needs this information.
+                          Should it be generated by the frontend,
+                          or does this impose unnecessary work for
+                          optimizatinos that change the parameters of
+                          methods? */
+  int n_res;           /* number of results */
   type **res_type;
   /** needs pointer to it's ir_graph ??
   ir_graph *graph; **/
@@ -127,7 +128,7 @@ void *get_method_graph(type_method *method, ir_graph* graph);
 
 typedef struct {
   firm_kind kind;
-  ident *name;             // do I need a name?
+  ident *name;             /* do I need a name? */
   int n_types;
   /* type **unioned_type;    ... or something like that? */
   unsigned long visit;     /* visited counter for walks of the type information */
@@ -202,7 +203,7 @@ typedef struct {
   /* int n_enums;
   ir_node **enum    * Contains all constant nodes that represent a member
                      of the enum -- enumerators. */
-                    // is ir_node the propper array member?
+  /* is ir_node the propper array member? */
   unsigned long visit;     /* visited counter for walks of the type information */
 } type_enumeration;
 
index ba68f29..fbe4f6e 100644 (file)
@@ -137,8 +137,7 @@ long tarval_ord (tarval *, int *fail);
 
 int tarval_print (XP_PAR1, const xprintf_info *, XP_PARN);
 
-
-     /* Labeling of tarvals */
+/* Labeling of tarvals */
 label tarval_label (tarval *);
 void tarval_forall_labeled (int (*) (tarval *, void *), void *);