[libcxx-commits] [libcxx] a7e15b0 - [libc++] List the set of __config_site macros used for features

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 17 09:23:30 PDT 2020


Author: Louis Dionne
Date: 2020-04-17T12:23:17-04:00
New Revision: a7e15b062672c5bd1b88b4be76bf8af430901c53

URL: https://github.com/llvm/llvm-project/commit/a7e15b062672c5bd1b88b4be76bf8af430901c53
DIFF: https://github.com/llvm/llvm-project/commit/a7e15b062672c5bd1b88b4be76bf8af430901c53.diff

LOG: [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.

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/config.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py
index 1dfbfcb357f9..92833ceca567 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -629,22 +629,22 @@ def parse_config_site_and_add_features(self, header):
                 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
 
 


        


More information about the libcxx-commits mailing list