diff options
| author | Mads Marquart <mads@marquart.dk> | 2024-11-01 17:05:10 +0100 |
|---|---|---|
| committer | Mads Marquart <mads@marquart.dk> | 2024-11-01 17:07:19 +0100 |
| commit | e75a7ddad37feea205df1e4b568a5316b31da641 (patch) | |
| tree | b994f7a9fe3158ffe6b43dfded276968faa2e9c7 /compiler/rustc_target/src/spec | |
| parent | e1233153ac2dcc68013f9698430ac27c7abec099 (diff) | |
| download | rust-e75a7ddad37feea205df1e4b568a5316b31da641.tar.gz rust-e75a7ddad37feea205df1e4b568a5316b31da641.zip | |
Move Mach-O platform information to rustc_codegen_ssa::back::apple
To align with the general decision to have this sort of information there instead. Also use the visionOS values added in newer `object` release.
Diffstat (limited to 'compiler/rustc_target/src/spec')
| -rw-r--r-- | compiler/rustc_target/src/spec/base/apple/mod.rs | 19 | ||||
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 1 |
2 files changed, 1 insertions, 19 deletions
diff --git a/compiler/rustc_target/src/spec/base/apple/mod.rs b/compiler/rustc_target/src/spec/base/apple/mod.rs index 837af954a07..f45c8664093 100644 --- a/compiler/rustc_target/src/spec/base/apple/mod.rs +++ b/compiler/rustc_target/src/spec/base/apple/mod.rs @@ -3,7 +3,7 @@ use std::env; use crate::spec::{ Cc, DebuginfoKind, FramePointer, LinkerFlavor, Lld, SplitDebuginfo, StackProbeType, StaticCow, - Target, TargetOptions, cvs, + TargetOptions, cvs, }; #[cfg(test)] @@ -156,23 +156,6 @@ pub(crate) fn base( (opts, unversioned_llvm_target(os, arch, abi), arch.target_arch()) } -pub fn platform(target: &Target) -> Option<u32> { - Some(match (&*target.os, &*target.abi) { - ("macos", _) => object::macho::PLATFORM_MACOS, - ("ios", "macabi") => object::macho::PLATFORM_MACCATALYST, - ("ios", "sim") => object::macho::PLATFORM_IOSSIMULATOR, - ("ios", _) => object::macho::PLATFORM_IOS, - ("watchos", "sim") => object::macho::PLATFORM_WATCHOSSIMULATOR, - ("watchos", _) => object::macho::PLATFORM_WATCHOS, - ("tvos", "sim") => object::macho::PLATFORM_TVOSSIMULATOR, - ("tvos", _) => object::macho::PLATFORM_TVOS, - // FIXME: Upgrade to `object-rs` 0.33+ implementation with visionOS platform definition - ("visionos", "sim") => 12, - ("visionos", _) => 11, - _ => return None, - }) -} - /// Generate part of the LLVM target triple. /// /// See `rustc_codegen_ssa::back::versioned_llvm_target` for the full triple passed to LLVM and diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 1265cc34549..a5bc90477b3 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -59,7 +59,6 @@ pub mod abi; pub mod crt_objects; mod base; -pub use base::apple::platform as current_apple_platform; pub use base::avr_gnu::ef_avr_arch; /// Linker is called through a C/C++ compiler. |
