Skip to content

Commit a800d1c

Browse files
compiler: s/make_indirect_byval/pass_by_stack_offset/
The previous name is just an LLVMism, which conveys almost nothing about what is actually meant by the function relative to the ABI. In doing so, remove an already-addressed FIXME.
1 parent 0cf89b5 commit a800d1c

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

compiler/rustc_target/src/abi/call/m68k.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
1414
return;
1515
}
1616
if arg.layout.is_aggregate() {
17-
arg.make_indirect_byval(None);
17+
arg.pass_by_stack_offset(None);
1818
} else {
1919
arg.extend_integer_width_to(32);
2020
}

compiler/rustc_target/src/abi/call/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub enum PassMode {
6464
/// (which ensures that padding is preserved and that we do not rely on LLVM's struct layout),
6565
/// and will use the alignment specified in `attrs.pointee_align` (if `Some`) or the type's
6666
/// alignment (if `None`). This means that the alignment will not always
67-
/// match the Rust type's alignment; see documentation of `make_indirect_byval` for more info.
67+
/// match the Rust type's alignment; see documentation of `pass_by_stack_offset` for more info.
6868
///
6969
/// `on_stack` cannot be true for unsized arguments, i.e., when `meta_attrs` is `Some`.
7070
Indirect { attrs: ArgAttributes, meta_attrs: Option<ArgAttributes>, on_stack: bool },
@@ -681,7 +681,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
681681
/// either in the caller (if the type's alignment is lower than the byval alignment)
682682
/// or in the callee (if the type's alignment is higher than the byval alignment),
683683
/// to ensure that Rust code never sees an underaligned pointer.
684-
pub fn make_indirect_byval(&mut self, byval_align: Option<Align>) {
684+
pub fn pass_by_stack_offset(&mut self, byval_align: Option<Align>) {
685685
assert!(!self.layout.is_unsized(), "used byval ABI for unsized layout");
686686
self.make_indirect();
687687
match self.mode {
@@ -879,8 +879,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
879879
{
880880
if abi == spec::abi::Abi::X86Interrupt {
881881
if let Some(arg) = self.args.first_mut() {
882-
// FIXME(pcwalton): This probably should use the x86 `byval` ABI...
883-
arg.make_indirect_byval(None);
882+
arg.pass_by_stack_offset(None);
884883
}
885884
return Ok(());
886885
}

compiler/rustc_target/src/abi/call/x86.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ where
122122
align_4
123123
};
124124

125-
arg.make_indirect_byval(Some(byval_align));
125+
arg.pass_by_stack_offset(Some(byval_align));
126126
} else {
127127
arg.extend_integer_width_to(32);
128128
}

compiler/rustc_target/src/abi/call/x86_64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ where
219219
if is_arg {
220220
// The x86_64 ABI doesn't have any special requirements for `byval` alignment,
221221
// the type's alignment is always used.
222-
arg.make_indirect_byval(None);
222+
arg.pass_by_stack_offset(None);
223223
} else {
224224
// `sret` parameter thus one less integer register available
225225
arg.make_indirect();

compiler/rustc_target/src/abi/call/xtensa.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ where
6868
*arg_gprs_left -= needed_arg_gprs;
6969

7070
if must_use_stack {
71-
arg.make_indirect_byval(None);
71+
arg.pass_by_stack_offset(None);
7272
} else if is_xtensa_aggregate(arg) {
7373
// Aggregates which are <= max_size will be passed in
7474
// registers if possible, so coerce to integers.

0 commit comments

Comments
 (0)