From d3e2e716c15bafd884179641bff57f9152869140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Mon, 26 Apr 2004 08:56:35 +0000 Subject: [PATCH] more debug output [r2755] --- ir/tr/entity.c | 9 --------- ir/tr/type.c | 32 ++++++++++++++++++++++++++++++++ ir/tr/type.h | 12 ++++++++++++ 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 10e2c37bf..426feff32 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -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 */ diff --git a/ir/tr/type.c b/ir/tr/type.c index ac45ba1c5..aeb6586f1 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -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 */ diff --git a/ir/tr/type.h b/ir/tr/type.h index 3a16942f4..ac5e6047d 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -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_ */ -- 2.20.1