From: Paul Robinson Date: Mon, 13 May 2019 17:18:58 +0000 (+0000) Subject: Stop defining negative versions of some lit feature keywords: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5d252509b24d9b48fc7c1a4bb367c574fc658fb;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360603 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/lit/lit/llvm/config.py b/utils/lit/lit/llvm/config.py index 250bbbcd1c3..6a0bfa1b207 100644 --- a/utils/lit/lit/llvm/config.py +++ b/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)