[clang] [clang][modules] Allow module maps with textual headers to be non-affecting (PR #89441)

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 15:14:44 PDT 2024


sam-mccall wrote:

> clang's headers all have proper modules now, are you sure you still need A?

We can't use `clang/lib/Headers/module.modulemap`, so we need something to describe those headers.

Why can't we? In our build system, it's the **build system's** job to generate modulemaps for your libraries, and you don't get to supply your own and build a PCM from it. This is a design decision with some far-reaching ups and downs.

It needs a little special bootstrapping logic for the compiler/stdlib headers that can't be part of any real library, but that bootstrapping is much simpler when we're just injecting one hand-written modulemap, and don't also need the build system to produce a PCM.

(I misspoke slightly: `A` is textual headers for clang+stdlib, and `B` is modular passthrough headers for the parts that are self-contained. `A` is special-cased in the bulid system, `B` is a normal library except that everything implicitly depends on it).

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


More information about the cfe-commits mailing list