diff options
| author | Paul Robinson <paul.robinson@sony.com> | 2019-05-13 17:18:58 +0000 |
|---|---|---|
| committer | Paul Robinson <paul.robinson@sony.com> | 2019-05-13 17:18:58 +0000 |
| commit | b38e4b28e399467577ffe1949ab023330a3d228f (patch) | |
| tree | f5c53704d35cd31458134c7c892ce02646e724bf /llvm/utils | |
| parent | 1aaf2a3c184ab4218904748282593dd721e011c2 (diff) | |
| download | bcm5719-llvm-b38e4b28e399467577ffe1949ab023330a3d228f.tar.gz bcm5719-llvm-b38e4b28e399467577ffe1949ab023330a3d228f.zip | |
Stop defining negative versions of some lit feature keywords:
zlib/nozlib, asan/not_asan, msan/not_msan, ubsan/not_ubsan.
We still have two other ways to express the absence of a feature.
First, we have the '!' operator to invert the sense of a keyword. For
example, given a feature that depends on zlib being unavailable, its
test can say:
REQUIRES: !zlib
Second, if a test doesn't play well with some features, such as
sanitizers, that test can say:
UNSUPPORTED: asan, msan
The different ways of writing these exclusions both have the same
technical effect, but have different implications to the reader.
llvm-svn: 360603
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/lit/lit/llvm/config.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py index 250bbbcd1c3..6a0bfa1b207 100644 --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -9,10 +9,6 @@ from lit.llvm.subst import FindTool from lit.llvm.subst import ToolSubst -def binary_feature(on, feature, off_prefix): - return feature if on else off_prefix + feature - - class LLVMConfig(object): def __init__(self, lit_config, config): @@ -73,13 +69,16 @@ class LLVMConfig(object): # Sanitizers. sanitizers = getattr(config, 'llvm_use_sanitizer', '') sanitizers = frozenset(x.lower() for x in sanitizers.split(';')) - features.add(binary_feature('address' in sanitizers, 'asan', 'not_')) - features.add(binary_feature('memory' in sanitizers, 'msan', 'not_')) - features.add(binary_feature( - 'undefined' in sanitizers, 'ubsan', 'not_')) + if 'address' in sanitizers: + features.add('asan') + if 'memory' in sanitizers: + features.add('msan') + if 'undefined' in sanitizers: + features.add('ubsan') have_zlib = getattr(config, 'have_zlib', None) - features.add(binary_feature(have_zlib, 'zlib', 'no')) + if have_zlib: + features.add('zlib') # Check if we should run long running tests. long_tests = lit_config.params.get('run_long_tests', None) |

