Introduce a -cc1 option "-emit-module", that creates a binary module

from the given source. -emit-module behaves similarly to -emit-pch,
except that Sema is somewhat more strict about the contents of
-emit-module. In the future, there are likely to be more interesting
differences.

llvm-svn: 138595
This commit is contained in:
Douglas Gregor
2011-08-25 22:30:56 +00:00
parent 371376010f
commit 69f74f80db
25 changed files with 99 additions and 67 deletions

View File

@@ -372,6 +372,7 @@ static const char *getActionName(frontend::ActionKind Kind) {
case frontend::EmitCodeGenOnly: return "-emit-codegen-only";
case frontend::EmitObj: return "-emit-obj";
case frontend::FixIt: return "-fixit";
case frontend::GenerateModule: return "-emit-module";
case frontend::GeneratePCH: return "-emit-pch";
case frontend::GeneratePTH: return "-emit-pth";
case frontend::InitOnly: return "-init-only";
@@ -1205,6 +1206,8 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
// fall-through!
case OPT_fixit:
Opts.ProgramAction = frontend::FixIt; break;
case OPT_emit_module:
Opts.ProgramAction = frontend::GenerateModule; break;
case OPT_emit_pch:
Opts.ProgramAction = frontend::GeneratePCH; break;
case OPT_emit_pth: