[all-commits] [llvm/llvm-project] 5c6a14: [C++20][Modules][Driver][HU 1/N] Initial handling ...

iains via All-commits all-commits at lists.llvm.org
Fri Apr 22 01:25:41 PDT 2022


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

  Changed paths:
    M clang/include/clang/Driver/Types.def
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/Types.cpp
    M clang/lib/Frontend/FrontendOptions.cpp
    A clang/test/Driver/Inputs/header-unit-01.hh
    A clang/test/Driver/cxx20-header-units-01.cpp

  Log Message:
  -----------
  [C++20][Modules][Driver][HU 1/N] Initial handling for -xc++-{system,user}-header.

This adds file types and handling for three input types, representing a C++20
header unit source:

 1. When provided with a complete pathname for the header.
 2. For a header to be looked up (by the frontend) in the user search paths
 3. For a header to be looked up in the system search paths.

We also add a pre-processed file type (although that is a single type, regardless
of the original input type).

These types may be specified with -xc++-{user,system,header-unit}-header xxxx.

These types allow us to disambiguate header unit jobs from PCH ones, and thus
we handle these differently from other header jobs in two ways:

 1. The job construction is altered to build a C++20 header unit (rather than a
    PCH file, as would be the case for other headers).
 2. When the type is "user" or "system" we defer checking for the file until the
    front end is run, since we need to look up the header in the relevant paths
    which are not known at this point.

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




More information about the All-commits mailing list