@@ -73,20 +73,104 @@ 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
+
133
+ bool FrontendOptions::doesActionRequireInputs (ActionType action) {
134
+ switch (action) {
135
+ case ActionType::NoneAction:
136
+ case ActionType::PrintVersion:
137
+ return false ;
138
+ case ActionType::REPL:
139
+ case ActionType::Parse:
140
+ case ActionType::DumpParse:
141
+ case ActionType::EmitSyntax:
142
+ case ActionType::DumpInterfaceHash:
143
+ case ActionType::EmitImportedModules:
144
+ case ActionType::ScanDependencies:
145
+ case ActionType::ScanClangDependencies:
146
+ case ActionType::EmitPCH:
147
+ case ActionType::EmitPCM:
148
+ case ActionType::DumpPCM:
149
+ case ActionType::CompileModuleFromInterface:
150
+ case ActionType::TypecheckModuleFromInterface:
151
+ case ActionType::ResolveImports:
152
+ case ActionType::Typecheck:
153
+ case ActionType::DumpAST:
154
+ case ActionType::PrintAST:
155
+ case ActionType::DumpScopeMaps:
156
+ case ActionType::DumpTypeRefinementContexts:
157
+ case ActionType::EmitSILGen:
158
+ case ActionType::EmitSIL:
159
+ case ActionType::EmitModuleOnly:
160
+ case ActionType::MergeModules:
161
+ case ActionType::EmitSIBGen:
162
+ case ActionType::EmitSIB:
163
+ case ActionType::Immediate:
164
+ case ActionType::EmitAssembly:
165
+ case ActionType::EmitIR:
166
+ case ActionType::EmitBC:
167
+ case ActionType::EmitObject:
168
+ case ActionType::DumpTypeInfo:
169
+ return true ;
170
+ }
171
+ llvm_unreachable (" Unknown ActionType" );
172
+ }
173
+
90
174
void FrontendOptions::forAllOutputPaths (
91
175
const InputFile &input, llvm::function_ref<void (StringRef)> fn) const {
92
176
if (RequestedAction != FrontendOptions::ActionType::EmitModuleOnly &&
0 commit comments