aboutsummaryrefslogtreecommitdiff
path: root/gcc/sdbout.c
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2008-10-08 07:56:00 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2008-10-08 09:56:00 +0200
commita4a4f7755b77fb859050d11f62645d3a80a56ac8 (patch)
treeda3288f88a90aabebbda17d1a6577deb82574adb /gcc/sdbout.c
parent1ffcdc0226e4cd06e28251b8836569356bb9b445 (diff)
downloadgcc-a4a4f7755b77fb859050d11f62645d3a80a56ac8.zip
gcc-a4a4f7755b77fb859050d11f62645d3a80a56ac8.tar.gz
gcc-a4a4f7755b77fb859050d11f62645d3a80a56ac8.tar.bz2
sdbout.c (sdbout_one_type): Treat the value type CONST_DECL for enumerals.
2008-10-08 Kai Tietz <kai.tietz@onevision.com> * sdbout.c (sdbout_one_type): Treat the value type CONST_DECL for enumerals. From-SVN: r140964
Diffstat (limited to 'gcc/sdbout.c')
-rw-r--r--gcc/sdbout.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index e6f14fa..fe08a0b 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))