[clang] Support '-fmodule-file-home-is-cwd' for C++ modules. (PR #135147)

Michael Park via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 11 10:23:15 PDT 2025


mpark wrote:

Synced with @ChuanqiXu9 offline about this. Summarizing the discussion so far:
- There are some high-level concerns about the ecosystem, header units specifically. The complexity of the Clang interface and lack of support for header units.
- At Meta we are starting to use header units, but with the named modules scaffolding. More specifically, we give header units "names" with `-fmodule-name=`, provide `-fmodule-file=<name>=<pcm>` as well as `-fmodule-map-file=` to discover the header units and to get lazy loading.
- `-fmodule-embed-all-files` embeds the source files into the PCMs, allowing them to be moved to a different machine without relying on absolute filepaths of the local machine. This still leaves the absolute file paths in the PCMs, they are just not accessed. This makes them usable, but different machines do not provide identical PCMs, which causes cache misses on a distributed build system.
- `-fmodule-map-file-home-is-cwd` and `-fmodule-file-home-is-cwd` both already exist, and the fact that `-fmodule-file-home-is-cwd` does not work is arguably a quirk of how the code is written.

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


More information about the cfe-commits mailing list