diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-01-02 00:39:33 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1993-01-02 00:39:33 +0000 |
commit | 477f73a0165406253792363f9afa64756ccb4764 (patch) | |
tree | 882e159b60183a0745e05906ef0f871168d127a3 /gcc/sdbout.c | |
parent | bc51108ad228be375904b5f22aee671f0141f4f2 (diff) | |
download | gcc-477f73a0165406253792363f9afa64756ccb4764.tar.gz |
(plain_type_1): Distinguish some C integer types by name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3046 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sdbout.c')
-rw-r--r-- | gcc/sdbout.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 04093a83d81..b932fd0cc4f 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -462,6 +462,34 @@ plain_type_1 (type) case INTEGER_TYPE: { int size = int_size_in_bytes (type) * BITS_PER_UNIT; + + /* Carefully distinguish all the standard types of C, + without messing up if the language is not C. + Note that we check only for the names that contain spaces; + other names might occur by coincidence in other languages. */ + if (TYPE_NAME (type) != 0 + && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (type)) != 0 + && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE) + { + char *name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); + + if (!strcmp (name, "unsigned char")) + return T_UCHAR; + if (!strcmp (name, "signed char")) + return T_CHAR; + if (!strcmp (name, "unsigned int")) + return T_UINT; + if (!strcmp (name, "short int")) + return T_SHORT; + if (!strcmp (name, "short unsigned int")) + return T_USHORT; + if (!strcmp (name, "long int")) + return T_LONG; + if (!strcmp (name, "long unsigned int")) + return T_ULONG; + } + if (size == CHAR_TYPE_SIZE) return (TREE_UNSIGNED (type) ? T_UCHAR : T_CHAR); if (size == SHORT_TYPE_SIZE) |