[all-commits] [llvm/llvm-project] f811d7: [C++20] [Modules] Introduce -fexperimental-modules...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Sun Apr 14 20:56:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f811d7b50957b801788d7b171ddeb25b1fda415a
      https://github.com/llvm/llvm-project/commit/f811d7b50957b801788d7b171ddeb25b1fda415a
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
    M clang/include/clang/CodeGen/CodeGenAction.h
    M clang/include/clang/Driver/Options.td
    M clang/include/clang/Frontend/FrontendOptions.h
    M clang/lib/CodeGen/CodeGenAction.cpp
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/FrontendActions.cpp
    A clang/test/Driver/module-fgen-reduced-bmi.cppm
    A clang/test/Modules/modules-reduced-bmi.cppm

  Log Message:
  -----------
  [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (#85050)

This is the driver part of
https://github.com/llvm/llvm-project/pull/75894.

This patch introduces '-fexperimental-modules-reduced-bmi' to enable
generating the reduced BMI.

This patch did:
- When `-fexperimental-modules-reduced-bmi` is specified but
`--precompile` is not specified for a module unit, we'll skip the
precompile phase to avoid unnecessary two-phase compilation phases. Then
if `-c` is specified, we will generate the reduced BMI in CodeGenAction
as a by-product.
- When `-fexperimental-modules-reduced-bmi` is specified and
`--precompile` is specified, we will generate the reduced BMI in
GenerateModuleInterfaceAction as a by-product.
- When `-fexperimental-modules-reduced-bmi` is specified for a
non-module unit. We don't do anything nor try to give a warn. This is
more user friendly so that the end users can try to test and experiment
with the feature without asking help from the build systems.

The core design idea is that users should be able to enable this easily
with the existing cmake mechanisms.

The future plan for the flag is:
- Add this to clang19 and make it opt-in for 1~2 releases. It depends on
the testing feedback to decide how long we like to make it opt-in.
- Then we can announce the existing BMI generating may be deprecated and
suggesting people (end users or build systems) to enable this for 1~2
releases.
- Finally we will enable this by default. When that time comes, the term
`BMI` will refer to the reduced BMI today and the existing BMI will only
be meaningful to build systems which loves to support two phase
compilations.

I'll send release notes and document in seperate commits after this get
landed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list