Unrevert r280035 now that the clang-cl bug it exposed has been fixed by
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 30 Aug 2016 19:06:26 +0000 (19:06 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 30 Aug 2016 19:06:26 +0000 (19:06 +0000)
commitdd4ad3d2addc2bde8d0d37a1cf6bc77359a64b13
tree4b46f108d7e452e4fc51dd757851ac73d6208f28
parent8cd452d47137f94c2d00e9dccf11a3deb1c12f05
Unrevert r280035 now that the clang-cl bug it exposed has been fixed by
r280133. Original commit message:

C++ Modules TS: driver support for building modules.

This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.

The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.

As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.

This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.

llvm-svn: 280134
clang/include/clang/Driver/CC1Options.td
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/Types.def
clang/include/clang/Driver/Types.h
clang/lib/Driver/Driver.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Driver/Types.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Parse/Parser.cpp
clang/test/Driver/cl-pch.cpp
clang/test/Driver/modules-ts.cpp [new file with mode: 0644]