From d66fbe4cf411d1c544ded7aa546f4710a1323c45 Mon Sep 17 00:00:00 2001 From: ktietz Date: Wed, 8 Oct 2008 07:56:00 +0000 Subject: 2008-10-08 Kai Tietz * sdbout.c (sdbout_one_type): Treat the value type CONST_DECL for enumerals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140964 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/sdbout.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'gcc/sdbout.c') diff --git a/gcc/sdbout.c b/gcc/sdbout.c index e6f14fa2f78..fe08a0b6361 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -1177,14 +1177,21 @@ sdbout_one_type (tree type) if (TREE_CODE (type) == ENUMERAL_TYPE) { for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem)) - if (host_integerp (TREE_VALUE (tem), 0)) - { - PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem))); - PUT_SDB_INT_VAL (tree_low_cst (TREE_VALUE (tem), 0)); - PUT_SDB_SCL (C_MOE); - PUT_SDB_TYPE (T_MOE); - PUT_SDB_ENDEF; - } + { + tree value = TREE_VALUE (tem); + + if (TREE_CODE (value) == CONST_DECL) + value = DECL_INITIAL (value); + + if (host_integerp (value, 0)) + { + PUT_SDB_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem))); + PUT_SDB_INT_VAL (tree_low_cst (value, 0)); + PUT_SDB_SCL (C_MOE); + PUT_SDB_TYPE (T_MOE); + PUT_SDB_ENDEF; + } + } } else /* record or union type */ for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem)) -- cgit v1.2.1