@@ -221,27 +221,6 @@ static void addVersionString(const ArgList &inputArgs, ArgStringList &arguments,
221
221
arguments.push_back (inputArgs.MakeArgString (os.str ()));
222
222
}
223
223
224
- // / Returns true if the compiler depends on features provided by the ObjC
225
- // / runtime that are not present on the deployment target indicated by
226
- // / \p triple.
227
- static bool wantsObjCRuntime (const llvm::Triple &triple) {
228
- assert ((!triple.isTvOS () || triple.isiOS ()) &&
229
- " tvOS is considered a kind of iOS" );
230
-
231
- // When updating the versions listed here, please record the most recent
232
- // feature being depended on and when it was introduced:
233
- //
234
- // - Make assigning 'nil' to an NSMutableDictionary subscript delete the
235
- // entry, like it does for Swift.Dictionary, rather than trap.
236
- if (triple.isiOS ())
237
- return triple.isOSVersionLT (9 );
238
- if (triple.isMacOSX ())
239
- return triple.isMacOSXVersionLT (10 , 11 );
240
- if (triple.isWatchOS ())
241
- return false ;
242
- llvm_unreachable (" unknown Darwin OS" );
243
- }
244
-
245
224
void
246
225
toolchains::Darwin::addLinkerInputArgs (InvocationInfo &II,
247
226
const JobContext &context) const {
@@ -278,48 +257,6 @@ toolchains::Darwin::addLinkerInputArgs(InvocationInfo &II,
278
257
file_types::TY_SwiftModuleFile, " -add_ast_path" );
279
258
}
280
259
281
- static void findARCLiteLibPath (const toolchains::Darwin &TC,
282
- llvm::SmallVectorImpl<char > &ARCLiteLib) {
283
- auto & D = TC.getDriver ();
284
- llvm::sys::path::append (ARCLiteLib, D.getSwiftProgramPath ());
285
-
286
- llvm::sys::path::remove_filename (ARCLiteLib); // 'swift'
287
- llvm::sys::path::remove_filename (ARCLiteLib); // 'bin'
288
- llvm::sys::path::append (ARCLiteLib, " lib" , " arc" );
289
-
290
- if (!llvm::sys::fs::is_directory (ARCLiteLib)) {
291
- // If we don't have a 'lib/arc/' directory, find the "arclite" library
292
- // relative to the Clang in the active Xcode.
293
- ARCLiteLib.clear ();
294
- findXcodeClangLibPath (" arc" , ARCLiteLib);
295
- }
296
- }
297
-
298
- void
299
- toolchains::Darwin::addArgsToLinkARCLite (ArgStringList &Arguments,
300
- const JobContext &context) const {
301
- if (!context.Args .hasFlag (options::OPT_link_objc_runtime,
302
- options::OPT_no_link_objc_runtime,
303
- /* Default=*/ wantsObjCRuntime (getTriple ())))
304
- return ;
305
-
306
- llvm::SmallString<128 > ARCLiteLib;
307
- findARCLiteLibPath (*this , ARCLiteLib);
308
-
309
- if (!ARCLiteLib.empty ()) {
310
- llvm::sys::path::append (ARCLiteLib, " libarclite_" );
311
- ARCLiteLib += getPlatformNameForTriple (getTriple ());
312
- ARCLiteLib += " .a" ;
313
-
314
- Arguments.push_back (" -force_load" );
315
- Arguments.push_back (context.Args .MakeArgString (ARCLiteLib));
316
-
317
- // Arclite depends on CoreFoundation.
318
- Arguments.push_back (" -framework" );
319
- Arguments.push_back (" CoreFoundation" );
320
- }
321
- }
322
-
323
260
void toolchains::Darwin::addLTOLibArgs (ArgStringList &Arguments,
324
261
const JobContext &context) const {
325
262
if (!context.OI .LibLTOPath .empty ()) {
@@ -741,8 +678,6 @@ toolchains::Darwin::constructInvocation(const DynamicLinkJobAction &job,
741
678
if (llvm::sys::fs::exists (CompilerRTPath))
742
679
Arguments.push_back (context.Args .MakeArgString (CompilerRTPath));
743
680
744
- addArgsToLinkARCLite (Arguments, context);
745
-
746
681
if (job.shouldPerformLTO ()) {
747
682
addLTOLibArgs (Arguments, context);
748
683
}
@@ -857,23 +792,6 @@ std::string toolchains::Darwin::getGlobalDebugPathRemapping() const {
857
792
return {};
858
793
}
859
794
860
- static void validateLinkObjcRuntimeARCLiteLib (const toolchains::Darwin &TC,
861
- DiagnosticEngine &diags,
862
- const llvm::opt::ArgList &args) {
863
- auto Triple = TC.getTriple ();
864
- if (args.hasFlag (options::OPT_link_objc_runtime,
865
- options::OPT_no_link_objc_runtime,
866
- /* Default=*/ wantsObjCRuntime (Triple))) {
867
- llvm::SmallString<128 > ARCLiteLib;
868
- findARCLiteLibPath (TC, ARCLiteLib);
869
-
870
- if (ARCLiteLib.empty ()) {
871
- diags.diagnose (SourceLoc (),
872
- diag::warn_arclite_not_found_when_link_objc_runtime);
873
- }
874
- }
875
- }
876
-
877
795
static void validateDeploymentTarget (const toolchains::Darwin &TC,
878
796
DiagnosticEngine &diags,
879
797
const llvm::opt::ArgList &args) {
@@ -927,15 +845,6 @@ void
927
845
toolchains::Darwin::validateArguments (DiagnosticEngine &diags,
928
846
const llvm::opt::ArgList &args,
929
847
StringRef defaultTarget) const {
930
- if (!getDriver ().isDummyDriverForFrontendInvocation ()) {
931
- // Validating arclite library path when link-objc-runtime.
932
- // If the driver is just set up to retrieve the swift-frontend invocation,
933
- // we don't care about link-time, so we can skip this step, which may be
934
- // expensive since it might call to `xcrun` to find `clang` and `arclite`
935
- // relative to `clang`.
936
- validateLinkObjcRuntimeARCLiteLib (*this , diags, args);
937
- }
938
-
939
848
// Validating apple platforms deployment targets.
940
849
validateDeploymentTarget (*this , diags, args);
941
850
validateTargetVariant (*this , diags, args, defaultTarget);
@@ -945,6 +854,12 @@ toolchains::Darwin::validateArguments(DiagnosticEngine &diags,
945
854
diags.diagnose (SourceLoc (), diag::error_darwin_static_stdlib_not_supported);
946
855
}
947
856
857
+ // Validating darwin deprecated -link-objc-runtime.
858
+ if (args.hasArg (options::OPT_link_objc_runtime,
859
+ options::OPT_no_link_objc_runtime)) {
860
+ diags.diagnose (SourceLoc (), diag::warn_darwin_link_objc_deprecated);
861
+ }
862
+
948
863
// If a C++ standard library is specified, it has to be libc++.
949
864
if (auto arg = args.getLastArg (options::OPT_experimental_cxx_stdlib)) {
950
865
if (StringRef (arg->getValue ()) != " libc++" ) {
0 commit comments