Skip to content

Commit

Permalink
Change related spec files to use the new enum
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jan 6, 2021
1 parent fa4d8bc commit 8ee804d
Show file tree
Hide file tree
Showing 25 changed files with 50 additions and 37 deletions.
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/armebv7r_none_eabi.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Targets the Big endian Cortex-R4/R5 processor (ARMv7-R)

use crate::abi::Endian;
use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
use crate::spec::{Target, TargetOptions};

Expand All @@ -11,7 +12,7 @@ pub fn target() -> Target {
arch: "arm".to_string(),

options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
executables: true,
linker: Some("rust-lld".to_owned()),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/armebv7r_none_eabihf.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Targets the Cortex-R4F/R5F processor (ARMv7-R)

use crate::abi::Endian;
use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
use crate::spec::{Target, TargetOptions};

Expand All @@ -11,7 +12,7 @@ pub fn target() -> Target {
arch: "arm".to_string(),

options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),
executables: true,
linker: Some("rust-lld".to_owned()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
arch: "mips64".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
// NOTE(mips64r2) matches C toolchain
cpu: "mips64r2".to_string(),
features: "+mips64r2".to_string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,6 +12,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
arch: "mips64".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/mips_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
arch: "mips".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
cpu: "mips32r2".to_string(),
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
max_atomic_width: Some(32),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/mips_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,6 +12,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
arch: "mips".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/mips_unknown_linux_uclibc.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
arch: "mips".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
cpu: "mips32r2".to_string(),
features: "+mips32r2,+soft-float".to_string(),
max_atomic_width: Some(32),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".to_string(),
arch: "mips".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
cpu: "mips32r6".to_string(),
features: "+mips32r6".to_string(),
max_atomic_width: Some(32),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -7,7 +8,7 @@ pub fn target() -> Target {
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128".to_string(),
arch: "mips64".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
// NOTE(mips64r6) matches C toolchain
cpu: "mips64r6".to_string(),
features: "+mips64r6".to_string(),
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,6 +12,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, RelroLevel, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -15,6 +16,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,6 +12,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,6 +12,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64".to_string(),
arch: "powerpc64".to_string(),
options: TargetOptions { endian: "big".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/powerpc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -10,6 +11,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -10,6 +11,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/powerpc_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -10,6 +11,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions { endian: "big".to_string(), mcount: "_mcount".to_string(), ..base },
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
}
}
7 changes: 2 additions & 5 deletions compiler/rustc_target/src/spec/powerpc_unknown_netbsd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -10,10 +11,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions {
endian: "big".to_string(),
mcount: "__mcount".to_string(),
..base
},
options: TargetOptions { endian: Endian::Big, mcount: "__mcount".to_string(), ..base },
}
}
7 changes: 2 additions & 5 deletions compiler/rustc_target/src/spec/powerpc_wrs_vxworks.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,10 +12,6 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions {
endian: "big".to_string(),
features: "+secure-plt".to_string(),
..base
},
options: TargetOptions { endian: Endian::Big, features: "+secure-plt".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/powerpc_wrs_vxworks_spe.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -12,7 +13,7 @@ pub fn target() -> Target {
data_layout: "E-m:e-p:32:32-i64:64-n32".to_string(),
arch: "powerpc".to_string(),
options: TargetOptions {
endian: "big".to_string(),
endian: Endian::Big,
// feature msync would disable instruction 'fsync' which is not supported by fsl_p1p2
features: "+secure-plt,+msync".to_string(),
..base
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::abi::Endian;
use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
base.endian = Endian::Big;
// z10 is the oldest CPU supported by LLVM
base.cpu = "z10".to_string();
// FIXME: The data_layout string below and the ABI implementation in
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/sparc64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::abi::Endian;
use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
base.endian = Endian::Big;
base.cpu = "v9".to_string();
base.max_atomic_width = Some(64);

Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_target/src/spec/sparc64_unknown_netbsd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target, TargetOptions};

pub fn target() -> Target {
Expand All @@ -11,10 +12,6 @@ pub fn target() -> Target {
pointer_width: 64,
data_layout: "E-m:e-i64:64-n32:64-S128".to_string(),
arch: "sparc64".to_string(),
options: TargetOptions {
endian: "big".to_string(),
mcount: "__mcount".to_string(),
..base
},
options: TargetOptions { endian: Endian::Big, mcount: "__mcount".to_string(), ..base },
}
}
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/sparc64_unknown_openbsd.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::openbsd_base::opts();
base.endian = "big".to_string();
base.endian = Endian::Big;
base.cpu = "v9".to_string();
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());
base.max_atomic_width = Some(64);
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/sparc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::linux_gnu_base::opts();
base.endian = "big".to_string();
base.endian = Endian::Big;
base.cpu = "v9".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-mv8plus".to_string());
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/sparcv9_sun_solaris.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::abi::Endian;
use crate::spec::{LinkerFlavor, Target};

pub fn target() -> Target {
let mut base = super::solaris_base::opts();
base.endian = "big".to_string();
base.endian = Endian::Big;
base.pre_link_args.insert(LinkerFlavor::Gcc, vec!["-m64".to_string()]);
// llvm calls this "v9"
base.cpu = "v9".to_string();
Expand Down

0 comments on commit 8ee804d

Please sign in to comment.