Skip to content

Commit d8c52b3

Browse files
Rollup merge of #117702 - davidtwco:target-tier-refactors, r=petrochenkov
target: move base and target specifications Follow-up to #116004. In anticipation of later PRs where we'll want to add tidy checks to ensure that, for each target, we have a test or a platform support document or something like that, this PR moves target specifications into a directory on their own so that we can just list the files in this directory to get a list of all targets. - Base specifications are moved to `rustc_target::spec::base`. - Target specifications are moved to `rustc_target::spec::targets`. - All the other source files containing types used in the target specs remain in `rustc_target::spec`. - `rustc_target/src/spec/abi.rs` is moved to `rustc_target/src/spec/abi/mod.rs` (where there was already a `tests.rs`) for uniformity. r? ``@petrochenkov``
2 parents 5d00a5d + ef7ebaa commit d8c52b3

File tree

274 files changed

+479
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+479
-475
lines changed

compiler/rustc_target/src/spec/aarch64_fuchsia.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

compiler/rustc_target/src/spec/avr_unknown_gnu_atmega328.rs

Lines changed: 0 additions & 5 deletions
This file was deleted.

compiler/rustc_target/src/spec/android_base.rs renamed to compiler/rustc_target/src/spec/base/android.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use crate::spec::{SanitizerSet, TargetOptions};
1+
use crate::spec::{base, SanitizerSet, TargetOptions};
22

33
pub fn opts() -> TargetOptions {
4-
let mut base = super::linux_base::opts();
4+
let mut base = base::linux::opts();
55
base.os = "android".into();
66
base.is_like_android = true;
77
base.default_dwarf_version = 2;

compiler/rustc_target/src/spec/apple_base.rs renamed to compiler/rustc_target/src/spec/base/apple/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use std::{borrow::Cow, env};
22

3+
use crate::spec::{add_link_args, add_link_args_iter};
34
use crate::spec::{cvs, Cc, DebuginfoKind, FramePointer, LinkArgs};
45
use crate::spec::{LinkerFlavor, Lld, SplitDebuginfo, StaticCow, Target, TargetOptions};
56

67
#[cfg(test)]
7-
#[path = "apple/tests.rs"]
88
mod tests;
99

1010
use Arch::*;
@@ -102,13 +102,13 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: &'static str) -> LinkArgs {
102102
LinkerFlavor::Darwin(Cc::No, Lld::No),
103103
&["-arch", arch, "-platform_version"],
104104
);
105-
super::add_link_args_iter(
105+
add_link_args_iter(
106106
&mut args,
107107
LinkerFlavor::Darwin(Cc::No, Lld::No),
108108
[platform_name, platform_version.clone(), platform_version].into_iter(),
109109
);
110110
if abi != "macabi" {
111-
super::add_link_args(&mut args, LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-arch", arch]);
111+
add_link_args(&mut args, LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-arch", arch]);
112112
}
113113

114114
args

compiler/rustc_target/src/spec/apple/tests.rs renamed to compiler/rustc_target/src/spec/base/apple/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{
1+
use crate::spec::targets::{
22
aarch64_apple_darwin, aarch64_apple_ios_sim, aarch64_apple_watchos_sim, i686_apple_darwin,
33
x86_64_apple_darwin, x86_64_apple_ios, x86_64_apple_tvos, x86_64_apple_watchos_sim,
44
};

0 commit comments

Comments
 (0)