aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2018-07-02 03:39:48 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2018-07-02 03:39:48 +0000
commitd72596738aa8f37e53380694c3b83db306b78d63 (patch)
tree5353c418f7cb35770617f7ffff53878d78c429f5
parent4d78796dbabdd4f7628cdd9fa84567c1f5c540e5 (diff)
downloadgcc-d72596738aa8f37e53380694c3b83db306b78d63.zip
gcc-d72596738aa8f37e53380694c3b83db306b78d63.tar.gz
gcc-d72596738aa8f37e53380694c3b83db306b78d63.tar.bz2
Reinstate dump_generic_expr_loc
gcc/ChangeLog: * dumpfile.c (dump_generic_expr_loc): Undo removal of this function in r262149, changing "loc" param from source_location to const dump_location_t &. * dumpfile.h (dump_generic_expr_loc): Undo removal of this declaration, as above. From-SVN: r262295
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dumpfile.c22
-rw-r--r--gcc/dumpfile.h2
3 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 26dfb85..64ed2f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2018-07-02 David Malcolm <dmalcolm@redhat.com>
+
+ * dumpfile.c (dump_generic_expr_loc): Undo removal of this
+ function in r262149, changing "loc" param from source_location to
+ const dump_location_t &.
+ * dumpfile.h (dump_generic_expr_loc): Undo removal of this
+ declaration, as above.
+
2018-07-01 Paul Koning <ni1d@arrl.net>
* common/config/pdp11/pdp11-common.c (pdp11_handle_option): Handle
diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c
index 93bc651..5f69f9b 100644
--- a/gcc/dumpfile.c
+++ b/gcc/dumpfile.c
@@ -506,6 +506,28 @@ dump_generic_expr (dump_flags_t dump_kind, dump_flags_t extra_dump_flags,
print_generic_expr (alt_dump_file, t, dump_flags | extra_dump_flags);
}
+
+/* Similar to dump_generic_expr, except additionally print the source
+ location. */
+
+void
+dump_generic_expr_loc (dump_flags_t dump_kind, const dump_location_t &loc,
+ dump_flags_t extra_dump_flags, tree t)
+{
+ location_t srcloc = loc.get_location_t ();
+ if (dump_file && (dump_kind & pflags))
+ {
+ dump_loc (dump_kind, dump_file, srcloc);
+ print_generic_expr (dump_file, t, dump_flags | extra_dump_flags);
+ }
+
+ if (alt_dump_file && (dump_kind & alt_flags))
+ {
+ dump_loc (dump_kind, alt_dump_file, srcloc);
+ print_generic_expr (alt_dump_file, t, dump_flags | extra_dump_flags);
+ }
+}
+
/* Output a formatted message using FORMAT on appropriate dump streams. */
void
diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h
index 9828a3f..0e588a6 100644
--- a/gcc/dumpfile.h
+++ b/gcc/dumpfile.h
@@ -425,6 +425,8 @@ extern void dump_printf_loc (dump_flags_t, const dump_location_t &,
const char *, ...) ATTRIBUTE_PRINTF_3;
extern void dump_function (int phase, tree fn);
extern void dump_basic_block (dump_flags_t, basic_block, int);
+extern void dump_generic_expr_loc (dump_flags_t, const dump_location_t &,
+ dump_flags_t, tree);
extern void dump_generic_expr (dump_flags_t, dump_flags_t, tree);
extern void dump_gimple_stmt_loc (dump_flags_t, const dump_location_t &,
dump_flags_t, gimple *, int);