Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Exclude C++03 frozen headers from the modulemap #113572

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Oct 24, 2024

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

This is a temporary patch, eventually these headers should be
included in the modulemap as well.
@ldionne ldionne requested a review from a team as a code owner October 24, 2024 14:11
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Oct 24, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 24, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

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 --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:

@ldionne ldionne merged commit 460406a into llvm:main Oct 24, 2024
63 of 65 checks passed
@ldionne ldionne deleted the review/fix-headers-in-modulemap branch October 24, 2024 15:57
@frobtech frobtech mentioned this pull request Oct 25, 2024
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
This is a temporary patch, eventually these headers should be included
in the modulemap as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants