[libcxx-commits] [libcxx] [libc++] Exclude C++03 frozen headers from the modulemap (PR #113572)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 24 07:12:29 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

<details>
<summary>Changes</summary>

This is a temporary patch, eventually these headers should be included in the modulemap as well.

---
Full diff: https://github.com/llvm/llvm-project/pull/113572.diff


1 Files Affected:

- (modified) libcxx/utils/libcxx/header_information.py (+9) 


``````````diff
diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py
index c5849e80f085b6..528eb9995e19f4 100644
--- a/libcxx/utils/libcxx/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -95,6 +95,10 @@ def has_cxx20_module(self) -> bool:
         removed_in_20 = ["ccomplex", "ciso646", "cstdbool", "ctgmath"]
         return self.is_public() and not self.is_experimental() and not self.is_C_compatibility() and not self._name in removed_in_20
 
+    def is_cxx03_frozen_header(self) -> bool:
+        """Returns whether the header is a frozen C++03 support header."""
+        return self._name.startswith("__cxx03/")
+
     def is_in_modulemap(self) -> bool:
         """Returns whether a header should be listed in the modulemap."""
         # TODO: Should `__config_site` be in the modulemap?
@@ -118,6 +122,11 @@ def is_in_modulemap(self) -> bool:
         # burden ourself with maintaining them in any way.
         if self._name.startswith("ext/"):
             return False
+
+        # TODO: Frozen C++03 headers should probably be in the modulemap as well
+        if self.is_cxx03_frozen_header():
+            return False
+
         return True
 
     def __str__(self) -> str:

``````````

</details>


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


More information about the libcxx-commits mailing list