Skip to content

Commit 636804e

Browse files
committed
compiler: Hermit targets: Use functional update syntax
instead of mutating the base. Signed-off-by: Martin Kröning <[email protected]>
1 parent a4e1bf4 commit 636804e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
use crate::spec::Target;
1+
use crate::spec::{Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let mut base = super::hermit_base::opts();
5-
base.max_atomic_width = Some(128);
6-
base.features = "+v8a,+strict-align,+neon,+fp-armv8".into();
7-
84
Target {
95
llvm_target: "aarch64-unknown-hermit".into(),
106
pointer_width: 64,
117
arch: "aarch64".into(),
128
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
13-
options: base,
9+
options: TargetOptions {
10+
features: "+v8a,+strict-align,+neon,+fp-armv8".into(),
11+
max_atomic_width: Some(128),
12+
..super::hermit_base::opts()
13+
},
1414
}
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
use crate::spec::{StackProbeType, Target};
1+
use crate::spec::{StackProbeType, Target, TargetOptions};
22

33
pub fn target() -> Target {
4-
let mut base = super::hermit_base::opts();
5-
base.cpu = "x86-64".into();
6-
base.plt_by_default = false;
7-
base.max_atomic_width = Some(64);
8-
base.features = "+rdrnd,+rdseed".into();
9-
base.stack_probes = StackProbeType::X86;
10-
114
Target {
125
llvm_target: "x86_64-unknown-hermit".into(),
136
pointer_width: 64,
147
arch: "x86_64".into(),
158
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
169
.into(),
17-
options: base,
10+
options: TargetOptions {
11+
cpu: "x86-64".into(),
12+
features: "+rdrnd,+rdseed".into(),
13+
plt_by_default: false,
14+
max_atomic_width: Some(64),
15+
stack_probes: StackProbeType::X86,
16+
..super::hermit_base::opts()
17+
},
1818
}
1919
}

0 commit comments

Comments
 (0)