[C++20][Modules][HU 1/5] Introduce header units as a module type.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 20 Sep 2020 08:29:14 +0000 (09:29 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 25 Mar 2022 09:17:14 +0000 (09:17 +0000)
commit6c0e60e884a20016ccc0d7c7e6f06df089a0de86
tree9e39107ec89a3a8d97bb0b3583c7000725ec8c24
parentc48b4641c7baf9f7280d352c13299b3aa0203179
[C++20][Modules][HU 1/5] Introduce header units as a module type.

This is the first in a series of patches that introduce C++20 importable
header units.

These differ from clang header modules in that:
 (a) they are identifiable by an internal name
 (b) they represent the top level source for a single header - although
     that might include or import other headers.

We name importable header units with the path by which they are specified
(although that need not be the absolute path for the file).

So "foo/bar.h" would have a name "foo/bar.h".  Header units are made a
separate module type so that we can deal with diagnosing places where they
are permitted but a named module is not.

Differential Revision: https://reviews.llvm.org/D121095
17 files changed:
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Basic/Module.h
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/FrontendActions.h
clang/include/clang/Frontend/FrontendOptions.h
clang/include/clang/Lex/ModuleMap.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/Decl.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/FrontendActions.cpp
clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaModule.cpp
clang/test/Modules/cxx20-hu-01.cpp [new file with mode: 0644]