OSDN Git Service

2008-10-08 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Oct 2008 07:56:00 +0000 (07:56 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Oct 2008 07:56:00 +0000 (07:56 +0000)
        * 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/ChangeLog
gcc/sdbout.c

index abe7fdc..c7144e4 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-08  Kai Tietz  <kai.tietz@onevision.com>
+
+       * sdbout.c (sdbout_one_type): Treat the value type
+       CONST_DECL for enumerals.
+
 2008-10-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.md: Remove trailing white spaces.
index e6f14fa..fe08a0b 100644 (file)
@@ -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))