[libcxx-commits] [libcxx] Solves llvm/llvm-project#130486 (PR #130560)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 10 01:11:31 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Martin Licht (martinlicht)

<details>
<summary>Changes</summary>

Add _LIBCPP_REMOVE_TRANSITIVE_INCLUDES to the list of configuration macros

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


1 Files Affected:

- (modified) libcxx/docs/UserDocumentation.rst (+18) 


``````````diff
diff --git a/libcxx/docs/UserDocumentation.rst b/libcxx/docs/UserDocumentation.rst
index 2c1bc1373659c..b55651a62ec5e 100644
--- a/libcxx/docs/UserDocumentation.rst
+++ b/libcxx/docs/UserDocumentation.rst
@@ -128,6 +128,24 @@ enable or disable extended libc++ behavior.
   replacement scenarios from working, e.g. replacing `operator new` and
   expecting a non-replaced `operator new[]` to call the replaced `operator new`.
 
+**_LIBCPP_REMOVE_TRANSITIVE_INCLUDES**:
+  When this macro is defined, the standard library headers will adhere to a
+  stricter policy regarding the (transitive) inclusion of other standard library
+  headers, only guaranteeing to provide those definitions explicitly mandated by
+  the standard. Please notice that defining this macro might break any existing
+  codebase that implicitly relies on standard headers providing any definitions
+  not explicitly required by the standard.
+
+  The primary motivation for this configuration macro is to improve compilation
+  times. In most standard library implementations, header files include more
+  definitions than officially required because the implementation details give rise
+  to internal dependencies. The common practice is to have the standard headers
+  internally include other standard headers, but this generally results in
+  increased compilation overhead. This configuration option attempts to mitigate
+  this problem by avoiding such unnecessary inclusions. In addition, compiling
+  a codebase with this macro may improve maintainability by identifying
+  missing standard header inclusions.
+
 **_LIBCPP_DISABLE_DEPRECATION_WARNINGS**:
   This macro disables warnings when using deprecated components. For example,
   using `std::auto_ptr` when compiling in C++11 mode will normally trigger a

``````````

</details>


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


More information about the libcxx-commits mailing list