@@ -73,20 +73,63 @@ bool FrontendOptions::needsProperModuleName(ActionType action) {
73
73
74
74
bool FrontendOptions::shouldActionOnlyParse (ActionType action) {
75
75
switch (action) {
76
- case FrontendOptions:: ActionType::Parse:
77
- case FrontendOptions:: ActionType::DumpParse:
78
- case FrontendOptions:: ActionType::EmitSyntax:
79
- case FrontendOptions:: ActionType::DumpInterfaceHash:
80
- case FrontendOptions:: ActionType::EmitImportedModules:
81
- case FrontendOptions:: ActionType::ScanDependencies:
82
- case FrontendOptions:: ActionType::ScanClangDependencies:
83
- case FrontendOptions:: ActionType::PrintVersion:
76
+ case ActionType::Parse:
77
+ case ActionType::DumpParse:
78
+ case ActionType::EmitSyntax:
79
+ case ActionType::DumpInterfaceHash:
80
+ case ActionType::EmitImportedModules:
81
+ case ActionType::ScanDependencies:
82
+ case ActionType::ScanClangDependencies:
83
+ case ActionType::PrintVersion:
84
84
return true ;
85
85
default :
86
86
return false ;
87
87
}
88
88
}
89
89
90
+ bool FrontendOptions::doesActionRequireSwiftStandardLibrary (ActionType action) {
91
+ switch (action) {
92
+ case ActionType::NoneAction:
93
+ case ActionType::Parse:
94
+ case ActionType::DumpParse:
95
+ case ActionType::EmitSyntax:
96
+ case ActionType::DumpInterfaceHash:
97
+ case ActionType::EmitImportedModules:
98
+ case ActionType::ScanDependencies:
99
+ case ActionType::ScanClangDependencies:
100
+ case ActionType::PrintVersion:
101
+ case ActionType::EmitPCH:
102
+ case ActionType::EmitPCM:
103
+ case ActionType::DumpPCM:
104
+ case ActionType::CompileModuleFromInterface:
105
+ case ActionType::TypecheckModuleFromInterface:
106
+ return false ;
107
+ case ActionType::ResolveImports:
108
+ case ActionType::Typecheck:
109
+ case ActionType::DumpAST:
110
+ case ActionType::PrintAST:
111
+ case ActionType::DumpScopeMaps:
112
+ case ActionType::DumpTypeRefinementContexts:
113
+ case ActionType::EmitSILGen:
114
+ case ActionType::EmitSIL:
115
+ case ActionType::EmitModuleOnly:
116
+ case ActionType::MergeModules:
117
+ case ActionType::EmitSIBGen:
118
+ case ActionType::EmitSIB:
119
+ case ActionType::Immediate:
120
+ case ActionType::REPL:
121
+ case ActionType::EmitAssembly:
122
+ case ActionType::EmitIR:
123
+ case ActionType::EmitBC:
124
+ case ActionType::EmitObject:
125
+ case ActionType::DumpTypeInfo:
126
+ assert (!FrontendOptions::shouldActionOnlyParse (action) &&
127
+ " Parse-only actions should not load modules!" );
128
+ return true ;
129
+ }
130
+ llvm_unreachable (" Unknown ActionType" );
131
+ }
132
+
90
133
void FrontendOptions::forAllOutputPaths (
91
134
const InputFile &input, llvm::function_ref<void (StringRef)> fn) const {
92
135
if (RequestedAction != FrontendOptions::ActionType::EmitModuleOnly &&
0 commit comments