[Frontend] Make it erroneous if no frontend action is specified when invoking the frontend, and update tests.

Swift SVN r21584
This commit is contained in:
Argyrios Kyrtzidis
2014-08-29 19:17:37 +00:00
parent 31de6fb6f2
commit 628567bfe5
72 changed files with 85 additions and 74 deletions

View File

@@ -328,11 +328,15 @@ int frontend_main(ArrayRef<const char *>Args,
Invocation.setMainExecutablePath(MainExecutablePath);
// Parse arguments.
// In the absence of any other mode indicators, emit an object file.
Invocation.getFrontendOptions().RequestedAction = FrontendOptions::EmitObject;
if (Invocation.parseArgs(Args, Instance.getDiags())) {
return 1;
}
if (Invocation.getFrontendOptions().RequestedAction ==
FrontendOptions::NoneAction) {
Instance.getDiags().diagnose(SourceLoc(),
diag::error_missing_frontend_action);
return 1;
}
// TODO: reorder, if possible, so that diagnostics emitted during
// CompilerInvocation::parseArgs are included in the serialized file.