swift -frontend "" shouldn't enter the REPL by default.

This patch fixes a problem where a CompilerInvocation
with no arguments would set the LangaugeOpts etc. up for
the deprecated-integrated-repl, including setting the
module name etc.  Now this only happens if you explicitly
invoke swift -frontend -repl.

Updated testcases that care, and added a new testcase to
ensure that an error is properly generated.

<rdar://problem/17918172>


Swift SVN r21537
This commit is contained in:
Sean Callanan
2014-08-28 18:38:13 +00:00
parent fc5e29284f
commit 2c50b0ca48
4 changed files with 5 additions and 9 deletions

View File

@@ -198,10 +198,7 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
}
} else {
// We don't have a mode, so determine a default.
if (Opts.InputFilenames.empty()) {
// We don't have any input files, so default to the REPL.
Action = FrontendOptions::REPL;
} else if (Args.hasArg(OPT_emit_module, OPT_emit_module_path)) {
if (Args.hasArg(OPT_emit_module, OPT_emit_module_path)) {
// We've been told to emit a module, but have no other mode indicators.
// As a result, put the frontend into EmitModuleOnly mode.
// (Setting up module output will be handled below.)