This is an archive of the discontinued LLVM Phabricator instance.

[docs] Document the one-phase style compilation to c++ standard modules
Changes PlannedPublic

Authored by ChuanqiXu on Sep 20 2022, 2:05 AM.

Details

Summary

This is the followup of D134267. The patch documents the new behavior with D134267.

Diff Detail

Event Timeline

ChuanqiXu created this revision.Sep 20 2022, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2022, 2:05 AM
ChuanqiXu requested review of this revision.Sep 20 2022, 2:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2022, 2:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
avogelsgesang added inline comments.
clang/docs/StandardCPlusPlusModules.rst
917
937
ChuanqiXu updated this revision to Diff 461782.Sep 20 2022, 8:36 PM
ChuanqiXu marked 2 inline comments as done.

Address comments.

Refine the behavior about partitions.

Thanks for doing this! The traditional Clang Header modules call this implicit and explicit modules.

Feel free to ignore, but I found this awesome article about implicit and explicit modules in Swift. They have same nomenclature and issues.

https://forums.swift.org/t/explicit-module-builds-the-new-swift-driver-and-swiftpm/36990

Thanks for doing this! The traditional Clang Header modules call this implicit and explicit modules.

Feel free to ignore, but I found this awesome article about implicit and explicit modules in Swift. They have same nomenclature and issues.

https://forums.swift.org/t/explicit-module-builds-the-new-swift-driver-and-swiftpm/36990

Thanks! If you have other opinions about the interface, you can discuss it in https://reviews.llvm.org/D134267.

ChuanqiXu updated this revision to Diff 468139.Oct 17 2022, 2:00 AM

Update to reflect the change in D134267

tahonermann added inline comments.
clang/docs/StandardCPlusPlusModules.rst
228–229

When an importable module unit is compiled to an object file,
a corresponding BMI is implicitly generated.

233–234
  • (1) If a file name is specified with the -fmodule-bmi-output={BMI-destination-path} option, then the BMI will be written to {BMI-destination-path}.
235–237

What happens if the source file name does not have an extension? E.g., for clang -c -std=c++20 -xc++-module file?

235–239
  • (2) Otherwise, the BMI will be written to a file within the module cache with a name constructed from the source file name with a .pcm extension. For example, if the source file is M.cppm, then the BMI will be implicitly written to a file named M.pcm in the module cache. See :ref:Module Cache Path<Module Cache Path> for the rules about the module cache.
ChuanqiXu planned changes to this revision.Oct 23 2022, 8:03 PM

Suspended due to the dependent patches suspended.