[driver] Add support for -emit-ir and -emit-bc.

Added driver-level support for generating commands with -emit-ir and -emit-bc as well integrated frontend support for handling -emit-ir and -emit-bc.

Swift SVN r11375
This commit is contained in:
Connor Wakamo
2013-12-17 02:43:40 +00:00
parent 3705f018ac
commit 5a603a3cd1
5 changed files with 22 additions and 3 deletions

View File

@@ -92,12 +92,15 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
// Determine what the user has asked the frontend to do.
FrontendOptions::ActionType Action;
if (const Arg *A = Args.getLastArg(OPT_modes_Group)) {
// TODO: add support for EmitIR, EmitBC
Option Opt = A->getOption();
if (Opt.matches(OPT_c)) {
Action = FrontendOptions::EmitObject;
} else if (Opt.matches(OPT_S)) {
Action = FrontendOptions::EmitAssembly;
} else if (Opt.matches(OPT_emit_ir)) {
Action = FrontendOptions::EmitIR;
} else if (Opt.matches(OPT_emit_bc)) {
Action = FrontendOptions::EmitBC;
} else if (Opt.matches(OPT_emit_sil)) {
Action = FrontendOptions::EmitSIL;
} else if (Opt.matches(OPT_emit_silgen)) {