[Frontend] Separate parse-only functionality into its own function, CompilerInstance::performParseOnly().

Parse-only is a hot path; keep the semantics for it separate from normal parsing, otherwise it is very
easy to introduce something expensive without checking for Invocation.getParseOnly().

Also cleans up a bit CompilerInstance::performParse() as well.

Swift SVN r17596
This commit is contained in:
Argyrios Kyrtzidis
2014-05-07 02:13:48 +00:00
parent eeea4caae0
commit 136284430c
5 changed files with 75 additions and 30 deletions

View File

@@ -159,9 +159,6 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Action = FrontendOptions::Parse;
} else if (Opt.matches(OPT_dump_parse)) {
Action = FrontendOptions::DumpParse;
// -dump-parse explicitly disables type-checking
Opts.ParseOnly = true;
} else if (Opt.matches(OPT_dump_ast)) {
Action = FrontendOptions::DumpAST;
} else if (Opt.matches(OPT_print_ast)) {