Migrate ipr/impl and ipr/utility-impl to C++20 module cxx.ipr.impl#328
Merged
Merged
Conversation
| } | ||
|
|
||
| impl::Scope* global_scope = unit.global_scope(); | ||
| string::arena::~arena() |
| // If we need to allocate storage more than what can possibly fit | ||
| // in a fresh pool object, just allocate that string on its own. | ||
| else if (n > bufsz) { | ||
| pool* new_pool = static_cast<pool*> |
| // remain sufficient room in the buffer. This is likely so if | ||
| // the buffer is allocated sufficiently large to start with. | ||
| else { | ||
| pool* new_pool = static_cast<pool*>(operator new(poolsz)); |
| { | ||
| string* header = allocate(n); | ||
| header->length = n; | ||
| std::copy(s, s + n, &header->data[0]); |
Merge the <ipr/impl> and <ipr/utility-impl> headers into a single module interface unit src/cxx-ipr-impl.ixx exporting module cxx.ipr.impl. The module implementation unit src/impl.cxx is adjusted accordingly. - Merge utility types (rb_tree, string pool, etc.) into the module interface - Remove src/utility.cxx (absorbed into impl.cxx) - Export only types that appear in the public API; ~75 internal infrastructure types (base templates, containers, comparison functions) are left unexported but reachable - Add GCC BUG workaround comments for cross-module destructor access - Update all test files to use 'import cxx.ipr.impl' Builds and passes tests with MSVC 19.50 and Clang 21. GCC 15/16 fail due to known module bugs (cross-module protected destructor access, internal compiler error in is_really_empty_class).
97376fc to
ed05753
Compare
GabrielDosReis
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge the
<ipr/impl>and<ipr/utility-impl>headers into a single module interface unitsrc/cxx-ipr-impl.ixxexporting modulecxx.ipr.impl. The module implementation unitsrc/impl.cxxis adjusted accordingly.Changes
src/utility.cxx(absorbed intoimpl.cxx)import cxx.ipr.implCompiler status
is_really_empty_classfromemit_mem_initializersAssisted by: Claude Opus 4.6