diff options
author | Patrick Palka <ppalka@redhat.com> | 2020-11-09 11:14:00 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2020-11-09 11:14:00 -0500 |
commit | 6624075e7e996d61143bf5fc106fa2cb61c614f6 (patch) | |
tree | 2d4a7373402260ff0fe9b972f2d49339a09fb5e5 /gcc/cp/parser.c | |
parent | 4394b1ce7731b04446555e034163b14b4f4a7f8d (diff) | |
download | gcc-6624075e7e996d61143bf5fc106fa2cb61c614f6.zip gcc-6624075e7e996d61143bf5fc106fa2cb61c614f6.tar.gz gcc-6624075e7e996d61143bf5fc106fa2cb61c614f6.tar.bz2 |
c-family: Avoid unnecessary work when -Wpragmas is being ignored
This speeds up handle_pragma_diagnostic by avoiding computing a spelling
suggestion for an unrecognized option inside a #pragma directive when
-Wpragmas warnings are being suppressed.
In the range-v3 library, which contains many instances of
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wfoo"
...
#pragma GCC diagnostic pop
(where -Wfoo stands for a warning option we don't recognize), this
reduces compile time by 33% for some of its tests.
gcc/c-family/ChangeLog:
* c-pragma.c (handle_pragma_diagnostic): Split the
unknown-option -Wpragmas diagnostic into a warning and a
subsequent note containing a spelling suggestion. Avoid
computing the suggestion if -Wpragmas warnings are being
suppressed.
gcc/testsuite/ChangeLog:
* gcc.dg/pragma-diag-6.c: Adjust expected diagnostics
accordingly.
Diffstat (limited to 'gcc/cp/parser.c')
0 files changed, 0 insertions, 0 deletions