From 0be456d2ee7116a06da144c1fbcba14159a28a9e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 9 Jul 2018 15:12:33 -0400 Subject: [PATCH 40/46] FIXME: add pass to params of remark --- gcc/diagnostic-remark.h | 10 +++++++--- gcc/diagnostic.c | 3 ++- gcc/optinfo-emit-diagnostics.cc | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gcc/diagnostic-remark.h b/gcc/diagnostic-remark.h index 6bf1214..b9552c5 100644 --- a/gcc/diagnostic-remark.h +++ b/gcc/diagnostic-remark.h @@ -21,9 +21,13 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_DIAGNOSTIC_REMARK_H #define GCC_DIAGNOSTIC_REMARK_H -/* This is in own header file so that it can use dump_location_t. */ +/* This is in own header file so that it can use dump_location_t + and opt_pass. */ -extern bool remark (const dump_location_t &, const char *, ...) - ATTRIBUTE_GCC_DIAG(2,3); +struct opt_pass; + +extern bool remark (const dump_location_t &, opt_pass *pass, + const char *, ...) + ATTRIBUTE_GCC_DIAG(3,4); #endif /* ! GCC_DIAGNOSTIC_REMARK_H */ diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index dbe3004..4848b45 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1282,7 +1282,8 @@ warning_n (location_t location, int opt, unsigned HOST_WIDE_INT n, // FIXME: we don't yet have a more fine-grained way of inhibiting remarks bool -remark (const dump_location_t &location, const char *gmsgid, ...) +remark (const dump_location_t &location, opt_pass *pass, + const char *gmsgid, ...) { va_list ap; va_start (ap, gmsgid); diff --git a/gcc/optinfo-emit-diagnostics.cc b/gcc/optinfo-emit-diagnostics.cc index 4c3a9c3..a47c2a7 100644 --- a/gcc/optinfo-emit-diagnostics.cc +++ b/gcc/optinfo-emit-diagnostics.cc @@ -212,7 +212,7 @@ emit_optinfo_as_diagnostic_remark (const optinfo *optinfo) print_optinfo_as_remark (&pp, optinfo); const char *msg = pp_formatted_text (&pp); - remark (optinfo->get_dump_location (), "%s", msg); + remark (optinfo->get_dump_location (), optinfo->get_pass (), "%s", msg); } #if CHECKING_P -- 1.8.5.3