*** empty log message ***
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 30 Nov 2000 15:05:18 +0000 (15:05 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 30 Nov 2000 15:05:18 +0000 (15:05 +0000)
[r75]

ir/common/common.c
ir/common/common.h
ir/common/firm.c
ir/ir/ircons.h
ir/ir/irdump.c
ir/ir/irdump.h
ir/ir/irprog.c
ir/tr/type.c
ir/tr/type.h
testprograms/oo_program_example.c

index 3d493fd..54308f9 100644 (file)
 /* returns the kind of the thing */
 firm_kind
 get_kind (void *firm_thing) {
+  assert (firm_thing);
   return *(firm_kind *)firm_thing;
 }
 
 
 const char* print_firm_kind(void *firm_thing) {
+  assert (firm_thing);
   switch (*(firm_kind *)firm_thing) {
     case k_entity: { return "k_enitity"; } break;
     case k_type_class: { return "k_type_class"; } break;
index 85b08b0..3f2f98d 100644 (file)
@@ -10,8 +10,6 @@
 # ifndef _COMMON_H_
 # define _COMMON_H_
 
-// GL# include <assert.h>
-
 /** Global flags.  Set these by autoconf?? **/
 
 /* There are two implementations of the Phi node construction.  The first
index 960c82c..a448a7f 100644 (file)
@@ -38,6 +38,5 @@ init_firm (void)
   init_cons ();
   /* Builds a construct allowing to access all information to be constructed
      later. */
-
   init_irprog ();
 }
index 75150fa..31f605f 100644 (file)
                       - size
                      - linkage_ptr_info
       If the attr.i.num is type_tag or size, the node contains an attribute
-    attr.i.*type     A pointer to a type_class.
+    attr.i.*type,    a pointer to a type_class.  The mode of the node is mode_i.
       if it is linkage_ptr_info it contains
-    attr.i.*ptrinfo  An ident holding information for the linker.
+    attr.i.*ptrinfo,  an ident holding information for the linker.  The mode
+      of the node is mode_p.
 
   THE SELECT NODE
   ---------------
   Parameters:
   *store        The current memory.
   *addr         A pointer to the variable to be read in this memory.
-  *mode         The mode of the loaded value.
 
   Inputs:
     The memory and a pointer to a variable in this memory.
index 2a26905..a805d96 100644 (file)
@@ -8,6 +8,7 @@
 
 # include "irnode_t.h"
 # include "irgraph_t.h"
+# include "irprog.h"
 # include "irdump.h"
 # include "panic.h"
 # include <string.h>
@@ -732,3 +733,18 @@ dump_ir_graph_w_types (ir_graph *irg)
   vcg_close();
   current_ir_graph = rem;
 }
+
+/***********************************************************************/
+/* dumps all graphs with the graph-dumper passed. Possible dumpers:    */
+/*  dump_ir_graph                                                      */
+/*  dump_ir_block_graph                                                */
+/*  dump_cfg                                                           */
+/*  dump_type_graph                                                    */
+/*  dump_ir_graph_w_types                                              */
+/***********************************************************************/
+void dump_all_ir_graphs (void dump_graph(ir_graph*)) {
+  int i;
+  for (i=0; i < get_irp_n_irgs(); i++) {
+    dump_graph(get_irp_irg(i));
+  }
+}
index c786238..f0dcb3b 100644 (file)
@@ -37,4 +37,12 @@ void dump_all_types (void);
 /* dumps a graph and the type inforamtion. */
 void dump_ir_graph_w_types (ir_graph *irg);
 
+/* dumps all graphs with the graph-dumper passed. Possible dumpers:
+ * dump_ir_graph
+ * dump_ir_block_graph
+ * dump_cfg
+ * dump_type_graph
+ * dump_ir_graph_w_types                                            */
+void dump_all_ir_graphs (void dump_graph(ir_graph*));
+
 # endif /* _IRDUMP_H_ */
index 18c55e1..81e92e1 100644 (file)
@@ -17,7 +17,8 @@ void init_irprog(void) {
   new_ir_prog ();
 }
 
-/* Create a new ir prog. Automatically called by init_firm through init_irprog. */
+/* Create a new ir prog. Automatically called by init_firm through
+   init_irprog. */
 ir_prog *new_ir_prog (void) {
   ir_prog *res;
 
index d1d6dc4..2c31539 100644 (file)
@@ -229,6 +229,7 @@ new_type_method (ident *name, int arity, int n_res)
   res = (type_method *) xmalloc (sizeof (type_method));
   add_irp_type((type *) res);   /* Remember the new type global. */
   res->kind = k_type_method;
+
   res->name = name;   // do I need the name, or is the name in entity sufficient?
   res->arity = arity;
   res->param_type = (type **) xmalloc (sizeof (type *) * arity);
@@ -577,14 +578,13 @@ new_type_primitive (ident *name, ir_mode *mode)
 }
 
 /* manipulate fields of type_primitive */
-/*
 
-char  *
+const char  *
 get_primitive_name  (type_primitive *primitive) {
   assert(primitive);
   return ID_TO_STR(primitive->name);
 }
-*/
+
 
 ident *
 get_primitive_ident (type_primitive *primitive) {
@@ -631,3 +631,51 @@ is_type(void *thing) {
   else
     return 0;
 }
+
+int
+is_type_class(void *thing) {
+  if (get_kind(thing) == k_type_class) return 1;
+  else return 0;
+}
+
+int
+is_type_strct(void *thing) {
+  if (get_kind(thing) == k_type_strct) return 1;
+  else return 0;
+}
+
+int
+is_type_method(void *thing) {
+  if (get_kind(thing) == k_type_method) return 1;
+  else return 0;
+}
+
+int
+is_type_union(void *thing) {
+  if (get_kind(thing) == k_type_union) return 1;
+  else return 0;
+}
+
+int
+is_type_array(void *thing) {
+  if (get_kind(thing) == k_type_array) return 1;
+  else return 0;
+}
+
+int
+is_type_pointer(void *thing) {
+  if (get_kind(thing) == k_type_pointer) return 1;
+  else return 0;
+}
+
+int
+is_type_enumeration(void *thing) {
+  if (get_kind(thing) == k_type_enumeration) return 1;
+  else return 0;
+}
+
+int
+is_type_primitive(void *thing) {
+  if (get_kind(thing) == k_type_primitive) return 1;
+  else return 0;
+}
index 50a25b0..3ac64b3 100644 (file)
@@ -499,7 +499,15 @@ union type {
 };
 
 
-int is_type(void *thing);
+int is_type            (void *thing);
+int is_type_class      (void *thing);
+int is_type_strct      (void *thing);
+int is_type_method     (void *thing);
+int is_type_union      (void *thing);
+int is_type_array      (void *thing);
+int is_type_pointer    (void *thing);
+int is_type_enumeration(void *thing);
+int is_type_primitive  (void *thing);
 
 
 
index 31f3bdb..7600861 100644 (file)
@@ -207,10 +207,16 @@ main(void)
   /****************************************************************************/
 
   printf("Dumping graphs of all procedures.\n");
+
+  dump_all_ir_graphs(dump_ir_block_graph);
+  dump_all_ir_graphs(dump_type_graph);
+
+  /*
   for (i = 0; i < get_irp_n_irgs(); i++) {
     dump_ir_block_graph (get_irp_irg(i));
     dump_type_graph(get_irp_irg(i));
   }
+  */
   //CS
   dump_all_types();