Move functionality for handling module maps as inputs from the -emit-module
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 28 Apr 2017 01:49:42 +0000 (01:49 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 28 Apr 2017 01:49:42 +0000 (01:49 +0000)
commitf74d946624f30d60fd3f90a9545a455308931c32
tree7b557e0dfc4727fa3d53543984bdcf0e1a1aeaca
parent7fca8c0757a5ee5f290844376c7f8c5f3c1ffcfe
Move functionality for handling module maps as inputs from the -emit-module
action to the general FrontendAction infrastructure.

This permits applying -E, -ast-dump, -fsyntax-only, and so on to a module map
compilation. (The -E form is not currently especially useful yet as there's no
good way to take the output and use it to actually build a module.)

In order to support this, -cc1 now accepts -x <lang>-module-map in all cases
where it accepts -x <lang> for a language we can parse (not ir/ast). And for
uniformity, we also accept -x <lang>-header for all such languages (we used
to reject for cuda and renderscript), and -x <lang>-cpp-output for all such
languages (we used to reject for c, cl, and renderscript).

(None of these new alternatives are accepted by the driver yet, so no
user-visible changes.)

llvm-svn: 301610
clang/include/clang/Frontend/FrontendActions.h
clang/include/clang/Frontend/FrontendOptions.h
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/FrontendAction.cpp
clang/lib/Frontend/FrontendActions.cpp
clang/lib/Frontend/FrontendOptions.cpp
clang/test/Modules/preprocess-module.cpp [new file with mode: 0644]