From 0e0b801c71725c2ec5fe0d24eb29ee2a974de321 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Fri, 11 Mar 2005 08:52:54 +0000 Subject: [PATCH] new accessor [r5356] --- ir/tr/type.c | 12 ++++++++++++ ir/tr/type.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/ir/tr/type.c b/ir/tr/type.c index 77d730745..5d2e4b3ee 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -348,6 +348,18 @@ set_type_alignment_bytes(type *tp, int align) { set_type_size_bits(tp, 8*align); } +/* Returns a human readable string for the enum entry. */ +const char *get_type_state_name(type_state s) { +#define X(a) case a: return #a; + switch (s) { + X(layout_undefined); + X(layout_fixed); + } + return ""; +#undef X +} + + type_state (get_type_state)(const type *tp) { return _get_type_state(tp); } diff --git a/ir/tr/type.h b/ir/tr/type.h index 4e2c9c00a..1b796125f 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -162,6 +162,9 @@ typedef enum { types. */ } type_state; +/** Returns a human readable string for the enum entry. */ +const char *get_type_state_name(type_state s); + /** Returns the type layout state of a type. */ type_state get_type_state(const type *tp); -- 2.20.1