diff options
author | Mircea Trofin <mtrofin@google.com> | 2021-02-01 15:21:55 -0800 |
---|---|---|
committer | Mircea Trofin <mtrofin@google.com> | 2021-02-01 18:04:18 -0800 |
commit | 87f8a08ce36e5bc72f11129d2cf36b5848f86f63 (patch) | |
tree | fd911cf312ad0b3e7222f7de59268a29e7844f83 /llvm/utils/UpdateTestChecks/common.py | |
parent | b545667d0a4e8d3ca7d4789c3c4004b2816c1b84 (diff) | |
download | llvm-87f8a08ce36e5bc72f11129d2cf36b5848f86f63.zip llvm-87f8a08ce36e5bc72f11129d2cf36b5848f86f63.tar.gz llvm-87f8a08ce36e5bc72f11129d2cf36b5848f86f63.tar.bz2 |
[Utils] Add a switch controlling prefix warnings in UpdateTestChecks
The switch controls both unused prefix warnings, and warnings about
functions which differ under different runs for a prefix, and, thus, end
up not having asserts for that prefix.
(If the latter case spans to all functions, then the former case kicks
in)
The switch is on by default, and can be disabled.
Differential Revision: https://reviews.llvm.org/D95829
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/common.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py index 4befaec..a77dc63 100644 --- a/llvm/utils/UpdateTestChecks/common.py +++ b/llvm/utils/UpdateTestChecks/common.py @@ -30,9 +30,14 @@ def parse_commandline_args(parser): help='Activate CHECK line generation from this point forward') parser.add_argument('--disable', action='store_false', dest='enabled', help='Deactivate CHECK line generation from this point forward') + parser.add_argument('--disable-verbose-prefix-warnings', action='store_false', + default=True, + dest='verbose_prefix_warnings', + help='Disable warnings about unused prefixes.') args = parser.parse_args() - global _verbose + global _verbose, _verbose_prefix_warnings _verbose = args.verbose + _verbose_prefix_warnings = args.verbose_prefix_warnings return args @@ -272,8 +277,9 @@ class FunctionTestBuilder: self._func_order.update({prefix: []}) def finish_and_get_func_dict(self): - for prefix in self._get_failed_prefixes(): - warn('Prefix %s had conflicting output from different RUN lines for all functions' % (prefix,)) + if _verbose_prefix_warnings: + for prefix in self._get_failed_prefixes(): + warn('Prefix %s had conflicting output from different RUN lines for all functions' % (prefix,)) return self._func_dict def func_order(self): @@ -329,6 +335,9 @@ class FunctionTestBuilder: # so the body can't be common accross RUN lines. We use None to # indicate that. self._func_dict[prefix][func] = None + if _verbose_prefix_warnings: + warn('Function %s had conflicting output from different RUN lines for prefix %s' % ( + func, prefix)) continue self._func_dict[prefix][func] = function_body( |