]> granicus.if.org Git - llvm/commitdiff
[LitConfig] Silenced notes/warnings on quiet.
authorAndrew Trick <atrick@apple.com>
Tue, 8 Oct 2019 01:31:02 +0000 (01:31 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 8 Oct 2019 01:31:02 +0000 (01:31 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374009 91177308-0d34-0410-b5e6-96231b3b80d8

utils/lit/lit/LitConfig.py

index 35ff0590bd6bf89753fb9460183cc270479221e6..881d9fa86a58ac40f843b4719547027c1cd3bb36 100644 (file)
@@ -174,10 +174,12 @@ class LitConfig(object):
                                                kind, message))
 
     def note(self, message):
-        self._write_message('note', message)
+        if not self.quiet:
+            self._write_message('note', message)
 
     def warning(self, message):
-        self._write_message('warning', message)
+        if not self.quiet:
+            self._write_message('warning', message)
         self.numWarnings += 1
 
     def error(self, message):