diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-03 03:41:47 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-03 03:41:47 +0000 |
commit | e026e5761e5326b6b22b30a1e5391836451f9254 (patch) | |
tree | aa56cac1935a048daf6a597712da5bbee56347e1 /gcc | |
parent | 4304657c8c0576eedc28f600ca02f344a96f5b98 (diff) | |
download | gcc-e026e5761e5326b6b22b30a1e5391836451f9254.tar.gz |
* tree.h (TYPE_STRING_FLAG): Document that this field may be used
on INTEGER_TYPEs to indicate that it denotes a character type.
* tree.c (build_common_tree_nodes): Set TYPE_STRING_FLAG on
signed_char_type_node, unsigned_char_type_node and char_type_node.
* dwarf2out.c (base_type_die): Treat CHAR_TYPE identically to
INTEGER_TYPE. Use TYPE_STRING_FLAG to decide whether to emit
a DW_ATE_[un]signed_char instead of a DW_ATE_[un]signed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 25 | ||||
-rw-r--r-- | gcc/tree.c | 3 | ||||
-rw-r--r-- | gcc/tree.h | 2 |
4 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7525f4c8258..103892c02c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2006-02-02 Roger Sayle <roger@eyesopen.com> + + * tree.h (TYPE_STRING_FLAG): Document that this field may be used + on INTEGER_TYPEs to indicate that it denotes a character type. + * tree.c (build_common_tree_nodes): Set TYPE_STRING_FLAG on + signed_char_type_node, unsigned_char_type_node and char_type_node. + * dwarf2out.c (base_type_die): Treat CHAR_TYPE identically to + INTEGER_TYPE. Use TYPE_STRING_FLAG to decide whether to emit + a DW_ATE_[un]signed_char instead of a DW_ATE_[un]signed. + 2006-02-02 Zdenek Dvorak <dvorakz@suse.cz> Daniel Berlin <dberlin@dberlin.org> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 97420217131..3cffc4e1b2a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8097,30 +8097,19 @@ base_type_die (tree type) switch (TREE_CODE (type)) { + case CHAR_TYPE: case INTEGER_TYPE: - /* Carefully distinguish the C character types, 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_PRECISION (type) == CHAR_TYPE_SIZE - && (TYPE_MAIN_VARIANT (type) == char_type_node - || ! strcmp (type_name, "signed char") - || ! strcmp (type_name, "unsigned char")))) + if (TYPE_STRING_FLAG (type)) { if (TYPE_UNSIGNED (type)) - encoding = DW_ATE_unsigned; + encoding = DW_ATE_unsigned_char; else - encoding = DW_ATE_signed; - break; + encoding = DW_ATE_signed_char; } - /* else fall through. */ - - case CHAR_TYPE: - /* GNU Pascal/Ada CHAR type. Not used in C. */ - if (TYPE_UNSIGNED (type)) - encoding = DW_ATE_unsigned_char; + else if (TYPE_UNSIGNED (type)) + encoding = DW_ATE_unsigned; else - encoding = DW_ATE_signed_char; + encoding = DW_ATE_signed; break; case REAL_TYPE: diff --git a/gcc/tree.c b/gcc/tree.c index 456b3e1d2d5..9e912dfbf0e 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -6342,7 +6342,9 @@ build_common_tree_nodes (bool signed_char, bool signed_sizetype) /* Define both `signed char' and `unsigned char'. */ signed_char_type_node = make_signed_type (CHAR_TYPE_SIZE); + TYPE_STRING_FLAG (signed_char_type_node) = 1; unsigned_char_type_node = make_unsigned_type (CHAR_TYPE_SIZE); + TYPE_STRING_FLAG (unsigned_char_type_node) = 1; /* Define `char', which is like either `signed char' or `unsigned char' but not the same as either. */ @@ -6350,6 +6352,7 @@ build_common_tree_nodes (bool signed_char, bool signed_sizetype) = (signed_char ? make_signed_type (CHAR_TYPE_SIZE) : make_unsigned_type (CHAR_TYPE_SIZE)); + TYPE_STRING_FLAG (char_type_node) = 1; short_integer_type_node = make_signed_type (SHORT_TYPE_SIZE); short_unsigned_type_node = make_unsigned_type (SHORT_TYPE_SIZE); diff --git a/gcc/tree.h b/gcc/tree.h index 39497674f9c..13505ac4377 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2013,7 +2013,7 @@ struct tree_block GTY(()) /* If set in an ARRAY_TYPE, indicates a string type (for languages that distinguish string from array of char). - If set in a SET_TYPE, indicates a bitstring type. */ + If set in a INTEGER_TYPE, indicates a character type. */ #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag) /* If non-NULL, this is an upper bound of the size (in bytes) of an |