[all-commits] [llvm/llvm-project] 4c4ff0: [C++20][Modules][Driver][HU 2/N] Add fmodule-heade...

iains via All-commits all-commits at lists.llvm.org
Fri Apr 22 06:15:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c4ff004a2702b9b7538efd569bb621a5efac8f3
      https://github.com/llvm/llvm-project/commit/4c4ff004a2702b9b7538efd569bb621a5efac8f3
  Author: Iain Sandoe <iain at sandoe.co.uk>
  Date:   2022-04-22 (Fri, 22 Apr 2022)

  Changed paths:
    M clang/docs/ClangCommandLineReference.rst
    M clang/include/clang/Driver/Driver.h
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/Driver.cpp
    A clang/test/Driver/cxx20-header-units-02.cpp

  Log Message:
  -----------
  [C++20][Modules][Driver][HU 2/N] Add fmodule-header, fmodule-header=

These command-line flags are alternates to providing the -x
c++-*-header indicators that we are building a header unit.

Act on fmodule-header= for headers on the c/l:

If we have x.hh -fmodule-header, then we should treat that header
as a header unit input (equivalent to -xc++-header-unit-header x.hh).

Likewise, for fmodule-header={user,system} the source should be now
recognised as a header unit input (since this can affect the job list
that we need).

It's not practical to recognise a header without any suffix so
-fmodule-header=system foo isn't going to happen. Although
-fmodule-header=system foo.hh will work OK.  However we can make it
work if the user indicates that the item without a suffix is a valid
header. (so -fmodule-header=system -xc++-header vector)

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




More information about the All-commits mailing list