@@ -119,56 +119,6 @@ ArrayRef<const char *> Driver::getArgsWithoutProgramNameAndDriverMode(
119
119
return Args;
120
120
}
121
121
122
- static void validateBridgingHeaderArgs (DiagnosticEngine &diags,
123
- const ArgList &args) {
124
- if (!args.hasArgNoClaim (options::OPT_import_objc_header))
125
- return ;
126
-
127
- if (args.hasArgNoClaim (options::OPT_import_underlying_module))
128
- diags.diagnose ({}, diag::error_framework_bridging_header);
129
-
130
- if (args.hasArgNoClaim (options::OPT_emit_module_interface,
131
- options::OPT_emit_module_interface_path)) {
132
- diags.diagnose ({}, diag::error_bridging_header_module_interface);
133
- }
134
- }
135
-
136
- static void validateDeploymentTarget (DiagnosticEngine &diags,
137
- const ArgList &args) {
138
- const Arg *A = args.getLastArg (options::OPT_target);
139
- if (!A)
140
- return ;
141
-
142
- // Check minimum supported OS versions.
143
- llvm::Triple triple (llvm::Triple::normalize (A->getValue ()));
144
- if (triple.isMacOSX ()) {
145
- if (triple.isMacOSXVersionLT (10 , 9 ))
146
- diags.diagnose (SourceLoc (), diag::error_os_minimum_deployment,
147
- " OS X 10.9" );
148
- } else if (triple.isiOS ()) {
149
- if (triple.isTvOS ()) {
150
- if (triple.isOSVersionLT (9 , 0 )) {
151
- diags.diagnose (SourceLoc (), diag::error_os_minimum_deployment,
152
- " tvOS 9.0" );
153
- return ;
154
- }
155
- }
156
- if (triple.isOSVersionLT (7 ))
157
- diags.diagnose (SourceLoc (), diag::error_os_minimum_deployment,
158
- " iOS 7" );
159
- if (triple.isArch32Bit () && !triple.isOSVersionLT (11 )) {
160
- diags.diagnose (SourceLoc (), diag::error_ios_maximum_deployment_32,
161
- triple.getOSMajorVersion ());
162
- }
163
- } else if (triple.isWatchOS ()) {
164
- if (triple.isOSVersionLT (2 , 0 )) {
165
- diags.diagnose (SourceLoc (), diag::error_os_minimum_deployment,
166
- " watchOS 2.0" );
167
- return ;
168
- }
169
- }
170
- }
171
-
172
122
static void validateWarningControlArgs (DiagnosticEngine &diags,
173
123
const ArgList &args) {
174
124
if (args.hasArg (options::OPT_suppress_warnings) &&
@@ -258,10 +208,23 @@ static void validateAutolinkingArgs(DiagnosticEngine &diags,
258
208
forceLoadArg->getSpelling (), incrementalArg->getSpelling ());
259
209
}
260
210
211
+ static void validateBridgingHeaderArgs (DiagnosticEngine &diags,
212
+ const ArgList &args) {
213
+ if (!args.hasArgNoClaim (options::OPT_import_objc_header))
214
+ return ;
215
+
216
+ if (args.hasArgNoClaim (options::OPT_import_underlying_module))
217
+ diags.diagnose ({}, diag::error_framework_bridging_header);
218
+
219
+ if (args.hasArgNoClaim (options::OPT_emit_module_interface,
220
+ options::OPT_emit_module_interface_path)) {
221
+ diags.diagnose ({}, diag::error_bridging_header_module_interface);
222
+ }
223
+ }
224
+
261
225
// / Perform miscellaneous early validation of arguments.
262
226
static void validateArgs (DiagnosticEngine &diags, const ArgList &args) {
263
227
validateBridgingHeaderArgs (diags, args);
264
- validateDeploymentTarget (diags, args);
265
228
validateWarningControlArgs (diags, args);
266
229
validateProfilingArgs (diags, args);
267
230
validateDebugInfoArgs (diags, args);
@@ -820,7 +783,6 @@ Driver::buildCompilation(const ToolChain &TC,
820
783
std::unique_ptr<DerivedArgList> TranslatedArgList (
821
784
translateInputAndPathArgs (*ArgList, workingDirectory));
822
785
823
- // TODO: We should check which validations could be moved to toolchain specific classes.
824
786
validateArgs (Diags, *TranslatedArgList);
825
787
826
788
// Perform toolchain specific args validation.
0 commit comments