Commit a4a4f775 by Kai Tietz Committed by Kai Tietz

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
parent 1ffcdc02
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> 2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md: Remove trailing white spaces. * config/i386/i386.md: Remove trailing white spaces.
......
...@@ -1177,15 +1177,22 @@ sdbout_one_type (tree type) ...@@ -1177,15 +1177,22 @@ sdbout_one_type (tree type)
if (TREE_CODE (type) == ENUMERAL_TYPE) if (TREE_CODE (type) == ENUMERAL_TYPE)
{ {
for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem)) for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
if (host_integerp (TREE_VALUE (tem), 0)) {
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_DEF (IDENTIFIER_POINTER (TREE_PURPOSE (tem)));
PUT_SDB_INT_VAL (tree_low_cst (TREE_VALUE (tem), 0)); PUT_SDB_INT_VAL (tree_low_cst (value, 0));
PUT_SDB_SCL (C_MOE); PUT_SDB_SCL (C_MOE);
PUT_SDB_TYPE (T_MOE); PUT_SDB_TYPE (T_MOE);
PUT_SDB_ENDEF; PUT_SDB_ENDEF;
} }
} }
}
else /* record or union type */ else /* record or union type */
for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem)) for (tem = TYPE_FIELDS (type); tem; tem = TREE_CHAIN (tem))
/* Output the name, type, position (in bits), size (in bits) /* Output the name, type, position (in bits), size (in bits)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment