more debug output
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 26 Apr 2004 08:56:35 +0000 (08:56 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Mon, 26 Apr 2004 08:56:35 +0000 (08:56 +0000)
[r2755]

ir/tr/entity.c
ir/tr/type.c
ir/tr/type.h

index 10e2c37..426feff 100644 (file)
@@ -996,15 +996,6 @@ void dump_entity (entity *ent) {
     else
       { printf ("\n  irg = NULL"); }
   }
-
-
-  printf("\n");
-  printf("\n");
-  printf("\n");
-  printf("\n");
-  printf("\n");
-
-
 }
 #undef X
 #else  /* DEBUG_libfirm */
index ac45ba1..aeb6586 100644 (file)
@@ -1533,3 +1533,35 @@ INLINE int is_compound_type(type *tp) {
   return (is_class_type(tp) || is_struct_type(tp) ||
          is_array_type(tp) || is_union_type(tp));
 }
+
+
+
+
+
+#if 1 || DEBUG_libfirm
+INLINE int dump_node_opcode(FILE *F, ir_node *n); /* from irdump.c */
+
+void dump_type (type *tp) {
+  int i;
+
+  printf("%s type %s (%ld)\n", get_tpop_name(get_type_tpop(tp)), get_type_name(tp), get_type_nr(tp));
+
+  switch (get_type_tpop_code(tp)) {
+
+  case tpo_class: {
+    printf("  members: ");
+    for (i = 0; i < get_class_n_members(tp); ++i) {
+      entity *mem = get_class_member(tp, i);
+      printf("\n    (%2d) %s:\t %s",
+            get_entity_offset(mem), get_type_name(get_entity_type(mem)), get_entity_name(mem));
+    }
+
+  } break;
+  default:
+    printf("not implemented\n");
+  }
+  printf("\n\n");
+}
+#else  /* DEBUG_libfirm */
+void dump_type (type *tp) {}
+#endif /* DEBUG_libfirm */
index 3a16942..ac5e604 100644 (file)
@@ -880,4 +880,16 @@ int is_compound_type(type *tp);
  */
 INLINE long get_type_nr(type *tp);
 
+/*******************************************************************/
+/** Debug aides                                                   **/
+/*******************************************************************/
+
+
+/** Write the type and all its attributes to stdout.
+ *
+ *  Writes the type and all its attributes to stdout if DEBUG_libfirm
+ *  is set.  Else does nothing. */
+void    dump_type (type *tp);
+
+
 # endif /* _TYPE_H_ */