mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user