Diagnose parse-only invocations trying to emit dependency information

Parse-only invocations do not support the proper creation of dependency files or reference dependency files because they have not yet run name binding.  Ban these invocations by diagnostic and add a new diagnostic specifically for reference dependencies.
This commit is contained in:
Robert Widmann
2018-06-29 15:23:49 -07:00
parent 6ecfe7a34d
commit c440b0ba5a
5 changed files with 54 additions and 5 deletions

View File

@@ -184,6 +184,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
bool FrontendOptions::canActionEmitDependencies(ActionType action) {
switch (action) {
case ActionType::NoneAction:
case ActionType::Parse:
case ActionType::DumpParse:
case ActionType::DumpInterfaceHash:
case ActionType::DumpAST:
@@ -194,7 +195,37 @@ bool FrontendOptions::canActionEmitDependencies(ActionType action) {
case ActionType::Immediate:
case ActionType::REPL:
return false;
case ActionType::Typecheck:
case ActionType::MergeModules:
case ActionType::EmitModuleOnly:
case ActionType::EmitPCH:
case ActionType::EmitSILGen:
case ActionType::EmitSIL:
case ActionType::EmitSIBGen:
case ActionType::EmitSIB:
case ActionType::EmitIR:
case ActionType::EmitBC:
case ActionType::EmitAssembly:
case ActionType::EmitObject:
case ActionType::EmitImportedModules:
return true;
}
}
bool FrontendOptions::canActionEmitReferenceDependencies(ActionType action) {
switch (action) {
case ActionType::NoneAction:
case ActionType::Parse:
case ActionType::DumpParse:
case ActionType::DumpInterfaceHash:
case ActionType::DumpAST:
case ActionType::EmitSyntax:
case ActionType::PrintAST:
case ActionType::DumpScopeMaps:
case ActionType::DumpTypeRefinementContexts:
case ActionType::Immediate:
case ActionType::REPL:
return false;
case ActionType::Typecheck:
case ActionType::MergeModules:
case ActionType::EmitModuleOnly: