diff options
author | David Malcolm <dmalcolm@redhat.com> | 2015-06-02 18:39:49 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2015-06-02 18:39:49 +0000 |
commit | 773ce42e90609a47d648eed62afc05a2f309f300 (patch) | |
tree | 6293a8085ebb4be50e27a5e1a6b94a55b62e71e6 /gcc | |
parent | 8ca528d9063404f392b3445766358702e63feed6 (diff) | |
download | gcc-773ce42e90609a47d648eed62afc05a2f309f300.zip gcc-773ce42e90609a47d648eed62afc05a2f309f300.tar.gz gcc-773ce42e90609a47d648eed62afc05a2f309f300.tar.bz2 |
Avoid unnecessary work when -Wmisleading-indentation isn't enabled
gcc/c-family/ChangeLog:
* c-indentation.c (warn_for_misleading_indentation): Bail out
immediately if -Wmisleading-indentation isn't enabled.
From-SVN: r224040
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-indentation.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 1af4e15..8fc0281 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-06-02 David Malcolm <dmalcolm@redhat.com> + + * c-indentation.c (warn_for_misleading_indentation): Bail out + immediately if -Wmisleading-indentation isn't enabled. + 2015-06-01 Martin Liska <mliska@suse.cz> * c-format.c (check_format_arg):Use new type-based pool allocator. diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c index 94565f6..9aeebae 100644 --- a/gcc/c-family/c-indentation.c +++ b/gcc/c-family/c-indentation.c @@ -373,6 +373,12 @@ warn_for_misleading_indentation (location_t guard_loc, enum cpp_ttype next_tok_type, const char *guard_kind) { + /* Early reject for the case where -Wmisleading-indentation is disabled, + to avoid doing work only to have the warning suppressed inside the + diagnostic machinery. */ + if (!warn_misleading_indentation) + return; + if (should_warn_for_misleading_indentation (guard_loc, body_loc, next_stmt_loc, |