From: Louis Dionne Date: Mon, 13 Apr 2020 21:15:37 +0000 (-0400) Subject: [libc++] List the set of __config_site macros used for features X-Git-Tag: llvmorg-12-init~8674 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7e15b062672c5bd1b88b4be76bf8af430901c53;p=platform%2Fupstream%2Fllvm.git [libc++] List the set of __config_site macros used for features Instead of creating Lit features for all __config_site macros automatically, only do so for macros that generate features actually used in the test suite. This makes it easier to know which ones are supported by the test suite at a glance. Note that the `libcpp-abi-version-vN` is dropped altogether, but it wasn't used anywhere. --- diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index 1dfbfcb..92833ce 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -629,22 +629,22 @@ class Configuration(object): define += '=%s' % (feature_macros[m]) self.cxx.modules_flags += [define] self.cxx.compile_flags += ['-Wno-macro-redefined'] - # Transform each macro name into the feature name used in the tests. + # Transform the following macro names from __config_site into features + # that can be used in the tests. # Ex. _LIBCPP_HAS_NO_THREADS -> libcpp-has-no-threads - for m in feature_macros: - if m == '_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS' or \ - m == '_LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT': - continue - if m == '_LIBCPP_ABI_VERSION': - self.config.available_features.add('libcpp-abi-version-v%s' - % feature_macros[m]) - continue - if m == '_LIBCPP_NO_VCRUNTIME': - self.config.available_features.add('libcpp-no-vcruntime') - continue - assert m.startswith('_LIBCPP_HAS_') or m.startswith('_LIBCPP_ABI_') - m = m.lower()[1:].replace('_', '-') - self.config.available_features.add(m) + translate = { + '_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE', + '_LIBCPP_HAS_NO_MONOTONIC_CLOCK', + '_LIBCPP_HAS_NO_STDIN', + '_LIBCPP_HAS_NO_STDOUT', + '_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS', + '_LIBCPP_HAS_NO_THREADS', + '_LIBCPP_HAS_THREAD_API_EXTERNAL', + '_LIBCPP_HAS_THREAD_API_PTHREAD', + '_LIBCPP_NO_VCRUNTIME' + } + for m in translate.intersection(feature_macros.keys()): + self.config.available_features.add(m.lower()[1:].replace('_', '-')) return feature_macros