summaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-12 13:04:43 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-12 13:04:43 +0000
commit0177b1e393a8ad321fb2cad644ed4bcaee2c4faf (patch)
tree6c55d1468abe6bfcb3d90e9788f768fef21263d8 /gcc/tree-pretty-print.c
parent8f852c44f495e3a43cd3ef00b8ba9912499507ba (diff)
downloadgcc-0177b1e393a8ad321fb2cad644ed4bcaee2c4faf.tar.gz
2012-03-12 Richard Guenther <rguenther@suse.de>
* tree.c (signed_or_unsigned_type_for): Use build_nonstandard_integer_type. (signed_type_for): Adjust documentation. (unsigned_type_for): Likewise. * tree-pretty-print.c (dump_generic_node): Use standard names for non-standard integer types if available. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 4b9b4536641..227999cd0d6 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -723,11 +723,41 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
}
else if (TREE_CODE (node) == INTEGER_TYPE)
{
- pp_string (buffer, (TYPE_UNSIGNED (node)
- ? "<unnamed-unsigned:"
- : "<unnamed-signed:"));
- pp_decimal_int (buffer, TYPE_PRECISION (node));
- pp_string (buffer, ">");
+ if (TYPE_PRECISION (node) == CHAR_TYPE_SIZE)
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "unsigned char"
+ : "signed char"));
+ else if (TYPE_PRECISION (node) == SHORT_TYPE_SIZE)
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "unsigned short"
+ : "signed short"));
+ else if (TYPE_PRECISION (node) == INT_TYPE_SIZE)
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "unsigned int"
+ : "signed int"));
+ else if (TYPE_PRECISION (node) == LONG_TYPE_SIZE)
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "unsigned long"
+ : "signed long"));
+ else if (TYPE_PRECISION (node) == LONG_LONG_TYPE_SIZE)
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "unsigned long long"
+ : "signed long long"));
+ else if (TYPE_PRECISION (node) >= CHAR_TYPE_SIZE
+ && exact_log2 (TYPE_PRECISION (node)))
+ {
+ pp_string (buffer, (TYPE_UNSIGNED (node) ? "uint" : "int"));
+ pp_decimal_int (buffer, TYPE_PRECISION (node));
+ pp_string (buffer, "_t");
+ }
+ else
+ {
+ pp_string (buffer, (TYPE_UNSIGNED (node)
+ ? "<unnamed-unsigned:"
+ : "<unnamed-signed:"));
+ pp_decimal_int (buffer, TYPE_PRECISION (node));
+ pp_string (buffer, ">");
+ }
}
else if (TREE_CODE (node) == COMPLEX_TYPE)
{