[llvm-branch-commits] [libcxx] 231dab0 - [libc++] Move header_information.py up from tests

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 27 01:57:21 PDT 2023


Author: Ian Anderson
Date: 2023-08-27T10:55:16+02:00
New Revision: 231dab0e40e7f654bf65b9182d00df7b0f8f9551

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

LOG: [libc++] Move header_information.py up from tests

I need to use header_information.py in a generator script that isn't for tests in an upcoming change. Move it up a level so that it's in utils/libcxx instead of utils/libcxx/tests.

Differential Revision: https://reviews.llvm.org/D157639

# Conflicts:
#	libcxx/test/libcxx/system_reserved_names.gen.py

Added: 
    libcxx/utils/libcxx/header_information.py

Modified: 
    libcxx/docs/Contributing.rst
    libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
    libcxx/test/libcxx/clang_tidy.gen.py
    libcxx/test/libcxx/double_include.gen.py
    libcxx/test/libcxx/header_inclusions.gen.py
    libcxx/test/libcxx/libcpp_version.gen.py
    libcxx/test/libcxx/module_std.gen.py
    libcxx/test/libcxx/modules_include.gen.py
    libcxx/test/libcxx/nasty_macros.gen.py
    libcxx/test/libcxx/no_assert_include.gen.py
    libcxx/test/libcxx/transitive_includes.gen.py

Removed: 
    libcxx/utils/libcxx/test/header_information.py


################################################################################
diff  --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
index cfae4d67ffdf48..3e3032ece99e47 100644
--- a/libcxx/docs/Contributing.rst
+++ b/libcxx/docs/Contributing.rst
@@ -49,7 +49,7 @@ sure you don't forget anything:
 
   - Did you add it to ``include/module.modulemap.in``?
   - Did you add it to ``include/CMakeLists.txt``?
-  - If it's a public header, did you update ``utils/libcxx/test/header_information.py``?
+  - If it's a public header, did you update ``utils/libcxx/header_information.py``?
 
 - Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?
 - Did you run the ``libcxx-generate-files`` target and verify its output?

diff  --git a/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py b/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
index f72c2574029366..a4e1c3c29c9369 100644
--- a/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
+++ b/libcxx/test/libcxx/assertions/headers_declare_verbose_abort.gen.py
@@ -14,7 +14,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
     # Skip C compatibility headers.

diff  --git a/libcxx/test/libcxx/clang_tidy.gen.py b/libcxx/test/libcxx/clang_tidy.gen.py
index a7b8e7b3ec549a..b2f1a171507d11 100644
--- a/libcxx/test/libcxx/clang_tidy.gen.py
+++ b/libcxx/test/libcxx/clang_tidy.gen.py
@@ -12,7 +12,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script

diff  --git a/libcxx/test/libcxx/double_include.gen.py b/libcxx/test/libcxx/double_include.gen.py
index ad18121d53be0d..85055dfc703de6 100644
--- a/libcxx/test/libcxx/double_include.gen.py
+++ b/libcxx/test/libcxx/double_include.gen.py
@@ -12,7 +12,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script

diff  --git a/libcxx/test/libcxx/header_inclusions.gen.py b/libcxx/test/libcxx/header_inclusions.gen.py
index f41ac27b651b3f..cdbc5b34b51525 100644
--- a/libcxx/test/libcxx/header_inclusions.gen.py
+++ b/libcxx/test/libcxx/header_inclusions.gen.py
@@ -13,7 +13,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers, mandatory_inclusions
+from libcxx.header_information import lit_header_restrictions, public_headers, mandatory_inclusions
 
 for header in public_headers:
   header_guard = lambda h: f"_LIBCPP_{h.upper().replace('.', '_').replace('/', '_')}"

diff  --git a/libcxx/test/libcxx/libcpp_version.gen.py b/libcxx/test/libcxx/libcpp_version.gen.py
index 6a43d5dc3e4aed..47439b08fe51b2 100644
--- a/libcxx/test/libcxx/libcpp_version.gen.py
+++ b/libcxx/test/libcxx/libcpp_version.gen.py
@@ -12,7 +12,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   print(f"""\

diff  --git a/libcxx/test/libcxx/module_std.gen.py b/libcxx/test/libcxx/module_std.gen.py
index 787317888d20d0..db0678e221bef4 100644
--- a/libcxx/test/libcxx/module_std.gen.py
+++ b/libcxx/test/libcxx/module_std.gen.py
@@ -21,7 +21,7 @@
 import sys
 
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import toplevel_headers
+from libcxx.header_information import toplevel_headers
 
 BLOCKLIT = (
     ""  # block Lit from interpreting a RUN/XFAIL/etc inside the generation script

diff  --git a/libcxx/test/libcxx/modules_include.gen.py b/libcxx/test/libcxx/modules_include.gen.py
index b6bad1b8a104d3..8ca50b0877eeff 100644
--- a/libcxx/test/libcxx/modules_include.gen.py
+++ b/libcxx/test/libcxx/modules_include.gen.py
@@ -14,7 +14,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   BLOCKLIT = '' # block Lit from interpreting a RUN/XFAIL/etc inside the generation script

diff  --git a/libcxx/test/libcxx/nasty_macros.gen.py b/libcxx/test/libcxx/nasty_macros.gen.py
index fdc308416f3418..3c501a981d0330 100644
--- a/libcxx/test/libcxx/nasty_macros.gen.py
+++ b/libcxx/test/libcxx/nasty_macros.gen.py
@@ -13,7 +13,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   print(f"""\

diff  --git a/libcxx/test/libcxx/no_assert_include.gen.py b/libcxx/test/libcxx/no_assert_include.gen.py
index 45152a35f3177b..a5e733d2b48a19 100644
--- a/libcxx/test/libcxx/no_assert_include.gen.py
+++ b/libcxx/test/libcxx/no_assert_include.gen.py
@@ -13,7 +13,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 for header in public_headers:
   if header == 'cassert':

diff  --git a/libcxx/test/libcxx/transitive_includes.gen.py b/libcxx/test/libcxx/transitive_includes.gen.py
index c446ceff7fef6a..2ac5277878beea 100644
--- a/libcxx/test/libcxx/transitive_includes.gen.py
+++ b/libcxx/test/libcxx/transitive_includes.gen.py
@@ -20,7 +20,7 @@
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.test.header_information import lit_header_restrictions, public_headers
+from libcxx.header_information import lit_header_restrictions, public_headers
 
 import re
 

diff  --git a/libcxx/utils/libcxx/test/header_information.py b/libcxx/utils/libcxx/header_information.py
similarity index 99%
rename from libcxx/utils/libcxx/test/header_information.py
rename to libcxx/utils/libcxx/header_information.py
index 9ca0e9548c7249..f23a896180b319 100644
--- a/libcxx/utils/libcxx/test/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -136,7 +136,7 @@ def is_header(file):
         and file.name != "libcxx.imp"
     )
 
-libcxx_root = pathlib.Path(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
+libcxx_root = pathlib.Path(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
 include = pathlib.Path(os.path.join(libcxx_root, "include"))
 test = pathlib.Path(os.path.join(libcxx_root, "test"))
 assert libcxx_root.exists()


        


More information about the llvm-branch-commits mailing list