From 8197ac2f3070fdaa79aac6541e45fbfdec64ccc4 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 10 Aug 2017 17:43:28 +0000 Subject: [PATCH] print-tree.c (print_node): Print location using the established format %s:%i%i. gcc/ChangeLog: * print-tree.c (print_node): Print location using the established format %s:%i%i. Replace spaces with colons. (debug_raw, debug): Ditto. From-SVN: r251030 --- gcc/ChangeLog | 7 +++++++ gcc/print-tree.c | 54 ++++++++++++++++++++++++------------------------ 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c49cb4aad01..cc434d2d33b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-08-10 Martin Sebor + + * print-tree.c (print_node): Print location using the established + format %s:%i%i. + Replace spaces with colons. + (debug_raw, debug): Ditto. + 2017-08-10 Martin Sebor PR c++/81586 diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 6a237cc1253..30c8d721433 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -444,13 +444,13 @@ print_node (FILE *file, const char *prefix, tree node, int indent, xloc = expand_location (DECL_SOURCE_LOCATION (node)); - fprintf (file, " file %s line %d col %d", xloc.file, xloc.line, + fprintf (file, " %s:%d:%d", xloc.file, xloc.line, xloc.column); if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) { print_node (file, "size", DECL_SIZE (node), indent + 4); - print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4); + print_node (file, "unit-size", DECL_SIZE_UNIT (node), indent + 4); if (code != FUNCTION_DECL || DECL_BUILT_IN (node)) indent_to (file, indent + 3); @@ -458,7 +458,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, if (DECL_USER_ALIGN (node)) fprintf (file, " user"); - fprintf (file, " align %d", DECL_ALIGN (node)); + fprintf (file, " align:%d", DECL_ALIGN (node)); if (code == FIELD_DECL) fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED, DECL_OFFSET_ALIGN (node)); @@ -466,9 +466,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent, if (code == FUNCTION_DECL && DECL_BUILT_IN (node)) { if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD) - fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node)); + fprintf (file, " built-in: BUILT_IN_MD:%d", DECL_FUNCTION_CODE (node)); else - fprintf (file, " built-in %s:%s", + fprintf (file, " built-in: %s:%s", built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)], built_in_names[(int) DECL_FUNCTION_CODE (node)]); } @@ -476,7 +476,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, if (code == FIELD_DECL) { print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4); - print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node), + print_node (file, "bit-offset", DECL_FIELD_BIT_OFFSET (node), indent + 4); if (DECL_BIT_FIELD_TYPE (node)) print_node (file, "bit_field_type", DECL_BIT_FIELD_TYPE (node), @@ -597,27 +597,27 @@ print_node (FILE *file, const char *prefix, tree node, int indent, fprintf (file, " %s", GET_MODE_NAME (mode)); print_node (file, "size", TYPE_SIZE (node), indent + 4); - print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4); + print_node (file, "unit-size", TYPE_SIZE_UNIT (node), indent + 4); indent_to (file, indent + 3); if (TYPE_USER_ALIGN (node)) fprintf (file, " user"); - fprintf (file, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC, + fprintf (file, " align:%d symtab:%d alias-set " HOST_WIDE_INT_PRINT_DEC, TYPE_ALIGN (node), TYPE_SYMTAB_ADDRESS (node), (HOST_WIDE_INT) TYPE_ALIAS_SET (node)); if (TYPE_STRUCTURAL_EQUALITY_P (node)) - fprintf (file, " structural equality"); + fprintf (file, " structural-equality"); else - dump_addr (file, " canonical type ", TYPE_CANONICAL (node)); + dump_addr (file, " canonical-type ", TYPE_CANONICAL (node)); print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4); if (INTEGRAL_TYPE_P (node) || code == REAL_TYPE || code == FIXED_POINT_TYPE) { - fprintf (file, " precision %d", TYPE_PRECISION (node)); + fprintf (file, " precision:%d", TYPE_PRECISION (node)); print_node_brief (file, "min", TYPE_MIN_VALUE (node), indent + 4); print_node_brief (file, "max", TYPE_MAX_VALUE (node), indent + 4); } @@ -627,7 +627,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, else if (code == ARRAY_TYPE) print_node (file, "domain", TYPE_DOMAIN (node), indent + 4); else if (code == VECTOR_TYPE) - fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node)); + fprintf (file, " nunits:%d", (int) TYPE_VECTOR_SUBPARTS (node)); else if (code == RECORD_TYPE || code == UNION_TYPE || code == QUAL_UNION_TYPE) @@ -686,7 +686,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, /* Buffer big enough to format a 32-bit UINT_MAX into, plus the text. */ char temp[15]; - sprintf (temp, "arg %u", i); + sprintf (temp, "arg:%u", i); print_node (file, temp, arg, indent + 4); i++; } @@ -701,7 +701,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, the text. */ char temp[15]; - sprintf (temp, "arg %d", i); + sprintf (temp, "arg:%d", i); print_node (file, temp, TREE_OPERAND (node, i), indent + 4); } } @@ -771,9 +771,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent, break; j--; if (i == j) - sprintf (buf, "elt%u: ", i); + sprintf (buf, "elt:%u: ", i); else - sprintf (buf, "elt%u...elt%u: ", i, j); + sprintf (buf, "elt:%u...%u: ", i, j); print_node (file, buf, VECTOR_CST_ELT (node, i), indent + 4); i = j; } @@ -814,14 +814,14 @@ print_node (FILE *file, const char *prefix, tree node, int indent, case TREE_VEC: len = TREE_VEC_LENGTH (node); - fprintf (file, " length %d", len); + fprintf (file, " length:%d", len); for (i = 0; i < len; i++) if (TREE_VEC_ELT (node, i)) { /* Buffer big enough to format a 32-bit UINT_MAX into, plus the text. */ char temp[15]; - sprintf (temp, "elt %d", i); + sprintf (temp, "elt:%d", i); print_node (file, temp, TREE_VEC_ELT (node, i), indent + 4); } break; @@ -831,7 +831,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, unsigned HOST_WIDE_INT cnt; tree index, value; len = CONSTRUCTOR_NELTS (node); - fprintf (file, " lngt %d", len); + fprintf (file, " length:%d", len); FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node), cnt, index, value) { @@ -885,7 +885,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, } indent_to (file, indent + 4); - fprintf (file, "version %u", SSA_NAME_VERSION (node)); + fprintf (file, "version:%u", SSA_NAME_VERSION (node)); if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node)) fprintf (file, " in-abnormal-phi"); if (SSA_NAME_IN_FREE_LIST (node)) @@ -907,7 +907,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent, for (i = 0; i < omp_clause_num_ops[OMP_CLAUSE_CODE (node)]; i++) { indent_to (file, indent + 4); - fprintf (file, "op %d:", i); + fprintf (file, "op-%d:", i); print_node_brief (file, "", OMP_CLAUSE_OPERAND (node, i), 0); } } @@ -921,19 +921,19 @@ print_node (FILE *file, const char *prefix, tree node, int indent, cl_target_option_print (file, indent + 4, TREE_TARGET_OPTION (node)); break; case IMPORTED_DECL: - fprintf (file, " imported declaration"); - print_node_brief (file, "associated declaration", + fprintf (file, " imported-declaration"); + print_node_brief (file, "associated-declaration", IMPORTED_DECL_ASSOCIATED_DECL (node), indent + 4); break; case TREE_BINFO: - fprintf (file, " bases %d", + fprintf (file, " bases:%d", vec_safe_length (BINFO_BASE_BINFOS (node))); print_node_brief (file, "offset", BINFO_OFFSET (node), indent + 4); print_node_brief (file, "virtuals", BINFO_VIRTUALS (node), indent + 4); - print_node_brief (file, "inheritance chain", + print_node_brief (file, "inheritance-chain", BINFO_INHERITANCE_CHAIN (node), indent + 4); break; @@ -1086,7 +1086,7 @@ debug_raw (vec &ref) FOR_EACH_VEC_ELT (ref, ix, elt) { - fprintf (stderr, "elt %d ", ix); + fprintf (stderr, "elt:%d ", ix); debug_raw (elt); } } @@ -1103,7 +1103,7 @@ debug (vec &ref) FOR_EACH_VEC_ELT (ref, ix, elt) { - fprintf (stderr, "elt %d ", ix); + fprintf (stderr, "elt:%d ", ix); debug (elt); } } -- 2.30.2