aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendOptions.cpp
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-01-10 13:40:38 +0000
committerIain Sandoe <iain@sandoe.co.uk>2022-04-22 09:24:29 +0100
commit5c6a14649843ccd2c50ed9e2fcacaa8ebd820ae8 (patch)
tree78bdb74b8f790e5e76207a05776ca20dc5fa5267 /clang/lib/Frontend/FrontendOptions.cpp
parent19a6dd33eeb2462d0e83d3cbed3823cfe56e2082 (diff)
downloadllvm-5c6a14649843ccd2c50ed9e2fcacaa8ebd820ae8.zip
llvm-5c6a14649843ccd2c50ed9e2fcacaa8ebd820ae8.tar.gz
llvm-5c6a14649843ccd2c50ed9e2fcacaa8ebd820ae8.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/FrontendOptions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendOptions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendOptions.cpp b/clang/lib/Frontend/FrontendOptions.cpp
index 37ac428..a7bdae3 100644
--- a/clang/lib/Frontend/FrontendOptions.cpp
+++ b/clang/lib/Frontend/FrontendOptions.cpp
@@ -27,7 +27,7 @@ InputKind FrontendOptions::getInputKindForExtension(StringRef Extension) {
.Cases("C", "cc", "cp", Language::CXX)
.Cases("cpp", "CPP", "c++", "cxx", "hpp", "hxx", Language::CXX)
.Case("cppm", Language::CXX)
- .Case("iim", InputKind(Language::CXX).getPreprocessed())
+ .Cases("iim", "iih", InputKind(Language::CXX).getPreprocessed())
.Case("cl", Language::OpenCL)
.Case("clcpp", Language::OpenCLCXX)
.Cases("cu", "cuh", Language::CUDA)