From: David Malcolm Date: Mon, 2 Jul 2018 03:39:48 +0000 (+0000) Subject: Reinstate dump_generic_expr_loc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d72596738aa8f37e53380694c3b83db306b78d63;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26dfb858939..64ed2f7e954 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-07-02 David Malcolm + + * 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 * common/config/pdp11/pdp11-common.c (pdp11_handle_option): Handle diff --git a/gcc/dumpfile.c b/gcc/dumpfile.c index 93bc65148dd..5f69f9bd646 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 9828a3f550c..0e588a6dac6 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);