[libcxx-commits] [PATCH] D155141: [libc++][Modules] Group the private detail headers into larger modules

Ian Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 12 22:37:57 PDT 2023


iana added a comment.

@ldionne is concerned about the maintainability of this patch. The module generation script is admittedly complicated.

1. `validate_exports` needs to be updated if module naming conventions change.
2. `write_libcxx_includes` needs to be updated when the subdirectories and files that need to be ignored are updated.
3. `build_include_tree` needs to be updated when new C++ versions are added.
4. `build_include_tree` needs to be updated when new macros control what gets included. `_LIBCPP_ENABLE_EXPERIMENTAL` and `_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY` were found while debugging module cycles that the script created.

It's probably not obvious that you might need to edit internal_module_attributes.json.in from time to time as includes change and new private detail headers are added.

While I don't personally think that doing any of these is particularly difficult or onerous, I must admit they aren't obvious, and several of them you won't realize you've forgotten them until some time later. e.g. you might not realize that you need to add c++26 until years down the road when the modules become cyclic on that version because the script never knew it needed to take that into consideration.

Nevertheless, I'm posting this review because 1) it produces a much nicer module map than can be done by hand, and 2) it might be necessary down the road if build performance suffers for having too many modules.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155141/new/

https://reviews.llvm.org/D155141



More information about the libcxx-commits mailing list