From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 01/12] diagnostics: add ability to associate diagnostics with rules from coding standards
Date: Thu, 23 Jun 2022 15:04:08 -0400 [thread overview]
Message-ID: <4e7b2b929bc98a5d12299546d86897c59313bdc4.camel@redhat.com> (raw)
In-Reply-To: <20220622223447.2462880-2-dmalcolm@redhat.com>
On Wed, 2022-06-22 at 18:34 -0400, David Malcolm wrote:
> gcc/ChangeLog:
> * common.opt (fdiagnostics-show-rules): New option.
> * diagnostic-format-json.cc
> (diagnostic_output_format_init_json):
> Fix up context->show_rules.
> * diagnostic-format-sarif.cc
> (diagnostic_output_format_init_sarif): Likewise.
> * diagnostic-metadata.h (diagnostic_metadata::rule): New
> class.
> (diagnostic_metadata::precanned_rule): New class.
> (diagnostic_metadata::add_rule): New.
> (diagnostic_metadata::get_num_rules): New.
> (diagnostic_metadata::get_rule): New.
> (diagnostic_metadata::m_rules): New field.
> * diagnostic.cc (diagnostic_initialize): Initialize
> show_rules.
> (print_any_rules): New.
> (diagnostic_report_diagnostic): Call it.
> * diagnostic.h (diagnostic_context::show_rules): New field.
> * doc/invoke.texi (-fno-diagnostics-show-rules): New option.
> * opts.cc (common_handle_option): Handle
> OPT_fdiagnostics_show_rules.
> * toplev.cc (general_init): Set up global_dc->show_rules.
>
> gcc/testsuite/ChangeLog:
> * gcc.dg/plugin/diagnostic-test-metadata.c: Expect " [STR34-
> C]" to
> be emitted at the "gets" call.
> * gcc.dg/plugin/diagnostic_plugin_test_metadata.c
> (pass_test_metadata::execute): Associate the "gets"
> diagnostic
> with a rule named "STR34-C".
>
> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
This one seems potentially useful to plugin authors without the rest of
the patch kit, so I've pushed it to trunk as: r13-1221-g0b14f590e3e9d9
(after a successful bootstrap & regression test on x86_64-pc-linux-gnu)
Dave
next prev parent reply other threads:[~2022-06-23 19:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 22:34 [PATCH 00/12] RFC: Replay of serialized diagnostics David Malcolm
2022-06-22 22:34 ` [PATCH 01/12] diagnostics: add ability to associate diagnostics with rules from coding standards David Malcolm
2022-06-23 19:04 ` David Malcolm [this message]
2022-06-22 22:34 ` [PATCH 02/12] diagnostics: associate rules with plugins in SARIF output David Malcolm
2022-06-22 22:34 ` [PATCH 03/12] Add more emit_diagnostic overloads David Malcolm
2022-06-23 16:39 ` Joseph Myers
2022-06-22 22:34 ` [PATCH 04/12] json: add json parsing support David Malcolm
2022-06-22 22:34 ` [PATCH 05/12] Placeholder libcpp fixups David Malcolm
2022-06-22 22:34 ` [PATCH 06/12] prune.exp: move multiline-handling to before other pruning David Malcolm
2022-06-22 22:34 ` [PATCH 07/12] Add deferred-locations.h/cc David Malcolm
2022-06-22 22:34 ` [PATCH 08/12] Add json-reader.h/cc David Malcolm
2022-06-22 22:34 ` [PATCH 09/12] Add json frontend David Malcolm
2022-06-22 22:34 ` [PATCH 10/12] Add sarif frontend David Malcolm
2022-06-22 22:34 ` [PATCH 11/12] Fixups to diagnostic-format-sarif.cc David Malcolm
2022-06-22 22:34 ` [PATCH 12/12] Work-in-progress of path remapping David Malcolm
2022-07-08 18:40 ` [PATCH 00/12] RFC: Replay of serialized diagnostics David Malcolm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e7b2b929bc98a5d12299546d86897c59313bdc4.camel@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).