[llvm-branch-commits] [libcxx] [libc++] Adds a FTM v2 data file generator. (PR #134555)

Mark de Wever via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Apr 6 12:26:50 PDT 2025


================
@@ -2579,11 +2639,32 @@ def generate_header_test_directory(self, path: os.path) -> None:
 
 
 def main():
+    #
+    # Note this generator switches from the data structures in this file (v1)
+    # to data structures in an external json file (v2). This project is in its
+    # transition phase. So currently both data structures are present.
+    #
+
+    # Generation using data structure v1
     produce_version_header()
     produce_tests()
     produce_docs()
 
-    # Example how to use the new generator to generate the output.
+    #
+    # Conversion of the v1 data to v2 data.
+    # This is a temporary solution.
+    #
+    produce_json(
+        os.path.join(source_root, "utils", "data", "feature_test_macro", "data.json")
+    )
+
+    # Generation using data structure v2
+    ftm = FeatureTestMacros(
+        os.path.join(source_root, "utils", "data", "feature_test_macro", "data.json")
+    )
+    ftm.generate_header_test_directory(os.path.join(macro_test_path, "v2"))
----------------
mordante wrote:

For reference https://github.com/llvm/llvm-project/commit/ee96014023174d0f3bb10ed60682ae5ce591577e overwrites the existing files and contains the diff of the existing files.

Note the new way adds a few additional files that are not in the current tests. For example, rcu is a header we have not yet implemented.

https://github.com/llvm/llvm-project/pull/134555


More information about the llvm-branch-commits mailing list