[all-commits] [llvm/llvm-project] 9dc9b2: [C++20][Modules][Driver][HU 4/N] Add fdirectives-o...

iains via All-commits all-commits at lists.llvm.org
Sat Apr 23 06:43:50 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9dc9b21488ee2bbf54e20807585a74a17a33fceb
  Author: Iain Sandoe <iain at sandoe.co.uk>
  Date:   2022-04-23 (Sat, 23 Apr 2022)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/cxx20-fdirectives-only.cpp

  Log Message:
  [C++20][Modules][Driver][HU 4/N] Add fdirectives-only mode for preprocessing output.

When the -fdirectives-only option is used together with -E, the preprocessor
output reflects evaluation of if/then/else directives.

Thus it preserves macros that are still live after such processing.
This output can be consumed by a second compilation to produce a header unit.

We automatically invoke this (with -E) when we know that the job produces a
header unit so that the preprocessed output reflects the macros that will be
defined when the binary HU is emitted.

Differential Revision: https://reviews.llvm.org/D121591

More information about the All-commits mailing list