Skip to content

Commit 78b968d

Browse files
committed
Add comment: data_layout
1 parent b088264 commit 78b968d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

compiler/rustc_target/src/spec/targets/riscv32e_unknown_none_elf.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, Targ
22

33
pub fn target() -> Target {
44
Target {
5+
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
6+
// `self.options.llvm_abiname`.
57
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
68
llvm_target: "riscv32".into(),
79
pointer_width: 32,
@@ -11,6 +13,7 @@ pub fn target() -> Target {
1113
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
1214
linker: Some("rust-lld".into()),
1315
cpu: "generic-rv32".into(),
16+
// The ILP32E ABI specifies the `data_layout`. See also `self.data_layout`.
1417
llvm_abiname: "ilp32e".into(),
1518
max_atomic_width: Some(32),
1619
atomic_cas: false,

compiler/rustc_target/src/spec/targets/riscv32em_unknown_none_elf.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, Targ
22

33
pub fn target() -> Target {
44
Target {
5+
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
6+
// `self.options.llvm_abiname`.
57
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
68
llvm_target: "riscv32".into(),
79
pointer_width: 32,
@@ -11,6 +13,7 @@ pub fn target() -> Target {
1113
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
1214
linker: Some("rust-lld".into()),
1315
cpu: "generic-rv32".into(),
16+
// The ILP32E ABI specifies the `data_layout`. See also `self.data_layout`.
1417
llvm_abiname: "ilp32e".into(),
1518
max_atomic_width: Some(32),
1619
atomic_cas: false,

compiler/rustc_target/src/spec/targets/riscv32emc_unknown_none_elf.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, Targ
22

33
pub fn target() -> Target {
44
Target {
5+
// The below `data_layout` is explicitly specified by the ilp32e ABI in LLVM. See also
6+
// `self.options.llvm_abiname`.
57
data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
68
llvm_target: "riscv32".into(),
79
pointer_width: 32,
@@ -11,6 +13,7 @@ pub fn target() -> Target {
1113
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
1214
linker: Some("rust-lld".into()),
1315
cpu: "generic-rv32".into(),
16+
// The ILP32E ABI specifies the `data_layout`. See also `self.data_layout`.
1417
llvm_abiname: "ilp32e".into(),
1518
max_atomic_width: Some(32),
1619
atomic_cas: false,

0 commit comments

Comments
 (0)