[libcxx-commits] [libcxx] e7bdfba - [libc++] Explicitly list Lit features from the config_site header

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 13 13:17:30 PDT 2020


Author: Louis Dionne
Date: 2020-05-13T16:17:22-04:00
New Revision: e7bdfba4f00d65f0e5d3ff5adb772f424ba7f02d

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

LOG: [libc++] Explicitly list Lit features from the config_site header

When grepping for unused features in the test suite, we will now find
those features and where they are defined, as opposed to thinking they
are dead features.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index ab6dd8f64a54..969cce519fe3 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -56,22 +56,22 @@
 # is defined after including <__config_site>, add a Lit feature called
 # `libcpp-xxx-yyy-zzz`. When a macro is defined to a specific value
 # (e.g. `_LIBCPP_ABI_VERSION=2`), the feature is `libcpp-xxx-yyy-zzz=<value>`.
-macros = [
-  '_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',
-  '_LIBCPP_ABI_VERSION',
-  '_LIBCPP_ABI_UNSTABLE'
-]
-for macro in macros:
+macros = {
+  '_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE': 'libcpp-has-no-global-filesystem-namespace',
+  '_LIBCPP_HAS_NO_MONOTONIC_CLOCK': 'libcpp-has-no-monotonic-clock',
+  '_LIBCPP_HAS_NO_STDIN': 'libcpp-has-no-stdin',
+  '_LIBCPP_HAS_NO_STDOUT': 'libcpp-has-no-stdout',
+  '_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS': 'libcpp-has-no-thread-unsafe-c-functions',
+  '_LIBCPP_HAS_NO_THREADS': 'libcpp-has-no-threads',
+  '_LIBCPP_HAS_THREAD_API_EXTERNAL': 'libcpp-has-thread-api-external',
+  '_LIBCPP_HAS_THREAD_API_PTHREAD': 'libcpp-has-thread-api-pthread',
+  '_LIBCPP_NO_VCRUNTIME': 'libcpp-no-vcruntime',
+  '_LIBCPP_ABI_VERSION': 'libcpp-abi-version',
+  '_LIBCPP_ABI_UNSTABLE': 'libcpp-abi-unstable'
+}
+for macro, feature in macros.items():
   features += [
-    Feature(name=lambda cfg, macro=macro: macro.lower()[1:].replace('_', '-') + (
+    Feature(name=lambda cfg, feature=feature: feature + (
               '={}'.format(compilerMacros(cfg)[macro]) if compilerMacros(cfg)[macro] else ''
             ),
             when=lambda cfg, macro=macro: macro in compilerMacros(cfg),


        


More information about the libcxx-commits mailing list