[LitConfig] Silenced notes/warnings on quiet.

Lit has a "quiet" option, -q, which is documented to "suppress no
error output". Previously, LitConfig displayed notes and warnings when
the quiet option was specified. The result was that it was not
possible to get only pertinent file/line information to be used by an
editor to jump to the location where checks were failing without
passing a number of unhelpful locations first. Here, the
implementations of LitConfig.note and LitConfig.warning are modified
to account for the quiet flag and avoid displaying if the flag has
indeed been set.

Patch by Nate Chandler

Reviewed by yln

Differential Revision: https://reviews.llvm.org/D68044

llvm-svn: 374009
This commit is contained in:
Andrew Trick 2019-10-08 01:31:02 +00:00
parent e21399b02e
commit cb194057b9
1 changed files with 4 additions and 2 deletions

View File

@ -174,9 +174,11 @@ class LitConfig(object):
kind, message))
def note(self, message):
if not self.quiet:
self._write_message('note', message)
def warning(self, message):
if not self.quiet:
self._write_message('warning', message)
self.numWarnings += 1