diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-05 14:49:42 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-06 12:02:14 +0200 |
commit | 90c3a62272313bb08cd5d9a948ff2d71af73b294 (patch) | |
tree | 44b87720221147d946d71b0282a85bc56c2a71d1 /gcc/tree-pretty-print.c | |
parent | ba837323dbda2bca5a1c8a4c78092a88241dcfa3 (diff) | |
download | gcc-90c3a62272313bb08cd5d9a948ff2d71af73b294.zip gcc-90c3a62272313bb08cd5d9a948ff2d71af73b294.tar.gz gcc-90c3a62272313bb08cd5d9a948ff2d71af73b294.tar.bz2 |
More consistently dump GIMPLE FE consumable stmts
The following makes more stmts consumable with the GIMPLE FE
when dumping with -gimple. In particular addresses in GIMPLE
operand position require wrapping with _Literal.
The TDF_ flag space is now exhausted and I've removed overlaps
and re-ordered things as to how it is supposed to work and
made it uint32_t and prepared the operator overloads for an
easy migration to uint64_t once required.
2021-10-05 Richard Biener <rguenther@suse.de>
PR c/102605
* dumpfile.h (TDF_GIMPLE_VAL): New.
(dump_flag): Re-order and adjust TDF_* flags. Make
the enum uint32_t. Use std::underlying_type in the
operator overloads.
(optgroup_flag): Likewise for the operator overloads.
* tree-pretty-print.c (dump_generic_node): Wrap ADDR_EXPR
in _Literal if TDF_GIMPLE_VAL.
* gimple-pretty-print.c (dump_gimple_assign): Add
TDF_GIMPLE_VAL to flags when dumping operands where only
is_gimple_val are allowed.
(dump_gimple_cond): Likewise.
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r-- | gcc/tree-pretty-print.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 81d86eb..30a3945 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -2873,10 +2873,18 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags, break; /* Unary arithmetic and logic expressions. */ + case ADDR_EXPR: + if (flags & TDF_GIMPLE_VAL) + { + pp_string (pp, "_Literal ("); + dump_generic_node (pp, TREE_TYPE (node), spc, + flags & ~TDF_GIMPLE_VAL, false); + pp_character (pp, ')'); + } + /* Fallthru. */ case NEGATE_EXPR: case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: - case ADDR_EXPR: case PREDECREMENT_EXPR: case PREINCREMENT_EXPR: case INDIRECT_REF: |