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):
# 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)