aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-02-03 03:41:47 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-02-03 03:41:47 +0000
commit05fa7d54d9d020b7257512ce91831ee6a9b1c7ac (patch)
treeaa56cac1935a048daf6a597712da5bbee56347e1 /gcc/dwarf2out.c
parent016925bc68140a35fbc0dac86841d02704fc350c (diff)
downloadgcc-05fa7d54d9d020b7257512ce91831ee6a9b1c7ac.zip
gcc-05fa7d54d9d020b7257512ce91831ee6a9b1c7ac.tar.gz
gcc-05fa7d54d9d020b7257512ce91831ee6a9b1c7ac.tar.bz2
tree.h (TYPE_STRING_FLAG): Document that this field may be used on INTEGER_TYPEs to indicate that it...
* 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. From-SVN: r110536
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 9742021..3cffc4e 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: