diff options
author | Kugan Vivekanandarajah <kuganv@linaro.org> | 2013-09-23 15:13:39 +0000 |
---|---|---|
committer | Christophe Lyon <clyon@gcc.gnu.org> | 2013-09-23 17:13:39 +0200 |
commit | a895a2b8a98464a019e6407e71769eb8aed99013 (patch) | |
tree | f8aeebb9d4ef8b224568c677be438c4daa431b63 /gcc/tree-pretty-print.c | |
parent | 984af6ac7579a3bc589401cf6d8651e98d0e9eb7 (diff) | |
download | gcc-a895a2b8a98464a019e6407e71769eb8aed99013.zip gcc-a895a2b8a98464a019e6407e71769eb8aed99013.tar.gz gcc-a895a2b8a98464a019e6407e71769eb8aed99013.tar.bz2 |
gimple-pretty-print.c (dump_ssaname_info): New function.
2013-09-23 Kugan Vivekanandarajah <kuganv@linaro.org>
gcc/
* gimple-pretty-print.c (dump_ssaname_info): New function.
(dump_gimple_phi): Call it.
(pp_gimple_stmt_1): Likewise.
* tree-core.h (tree_ssa_name): New union ssa_name_info_type field.
(range_info_def): Declare.
* tree-pretty-print.c (pp_double_int): New function.
(dump_generic_node): Call it.
* tree-pretty-print.h (pp_double_int): Declare.
* tree-ssa-alias.c (dump_alias_info): Check pointer type.
* tree-ssanames.h (range_info_def): New structure.
(value_range_type): Move definition here.
(set_range_info, value_range_type, duplicate_ssa_name_range_info):
Declare.
* tree-ssanames.c (make_ssa_name_fn): Check pointer type at
initialization.
(set_range_info): New function.
(get_range_info): Likewise.
(duplicate_ssa_name_range_info): Likewise.
(duplicate_ssa_name_fn): Check pointer type and call
duplicate_ssa_name_range_info.
* tree-ssa-copy.c (fini_copy_prop): Likewise.
* tree-vrp.c (value_range_type): Remove definition, now in
tree-ssanames.h.
(vrp_finalize): Call set_range_info to update value range of
SSA_NAMEs.
* tree.h (SSA_NAME_PTR_INFO): Macro changed to access via union.
(SSA_NAME_RANGE_INFO): New macro.
From-SVN: r202831
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 4c04816..a5f9a71 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -1062,29 +1062,9 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); pp_string (buffer, "B"); /* pseudo-unit */ } - else if (host_integerp (node, 0)) - pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); - else if (host_integerp (node, 1)) - pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node)); else - { - tree val = node; - unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (val); - HOST_WIDE_INT high = TREE_INT_CST_HIGH (val); - - if (tree_int_cst_sgn (val) < 0) - { - pp_minus (buffer); - high = ~high + !low; - low = -low; - } - /* Would "%x%0*x" or "%x%*0x" get zero-padding on all - systems? */ - sprintf (pp_buffer (buffer)->digit_buffer, - HOST_WIDE_INT_PRINT_DOUBLE_HEX, - (unsigned HOST_WIDE_INT) high, low); - pp_string (buffer, pp_buffer (buffer)->digit_buffer); - } + pp_double_int (buffer, tree_to_double_int (node), + TYPE_UNSIGNED (TREE_TYPE (node))); break; case REAL_CST: @@ -3196,3 +3176,31 @@ dump_function_header (FILE *dump_file, tree fdecl, int flags) else fprintf (dump_file, ")\n\n"); } + +/* Dump double_int D to pretty_printer PP. UNS is true + if D is unsigned and false otherwise. */ +void +pp_double_int (pretty_printer *pp, double_int d, bool uns) +{ + if (d.fits_shwi ()) + pp_wide_integer (pp, d.low); + else if (d.fits_uhwi ()) + pp_unsigned_wide_integer (pp, d.low); + else + { + unsigned HOST_WIDE_INT low = d.low; + HOST_WIDE_INT high = d.high; + if (!uns && d.is_negative ()) + { + pp_minus (pp); + high = ~high + !low; + low = -low; + } + /* Would "%x%0*x" or "%x%*0x" get zero-padding on all + systems? */ + sprintf (pp_buffer (pp)->digit_buffer, + HOST_WIDE_INT_PRINT_DOUBLE_HEX, + (unsigned HOST_WIDE_INT) high, low); + pp_string (pp, pp_buffer (pp)->digit_buffer); + } +} |