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.
This commit is contained in:
parent
0cf89b5336
commit
a800d1cf37
5 changed files with 7 additions and 8 deletions
|
@ -14,7 +14,7 @@ fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
|
|||
return;
|
||||
}
|
||||
if arg.layout.is_aggregate() {
|
||||
arg.make_indirect_byval(None);
|
||||
arg.pass_by_stack_offset(None);
|
||||
} else {
|
||||
arg.extend_integer_width_to(32);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ pub enum PassMode {
|
|||
/// (which ensures that padding is preserved and that we do not rely on LLVM's struct layout),
|
||||
/// and will use the alignment specified in `attrs.pointee_align` (if `Some`) or the type's
|
||||
/// alignment (if `None`). This means that the alignment will not always
|
||||
/// match the Rust type's alignment; see documentation of `make_indirect_byval` for more info.
|
||||
/// match the Rust type's alignment; see documentation of `pass_by_stack_offset` for more info.
|
||||
///
|
||||
/// `on_stack` cannot be true for unsized arguments, i.e., when `meta_attrs` is `Some`.
|
||||
Indirect { attrs: ArgAttributes, meta_attrs: Option<ArgAttributes>, on_stack: bool },
|
||||
|
@ -681,7 +681,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
|
|||
/// either in the caller (if the type's alignment is lower than the byval alignment)
|
||||
/// or in the callee (if the type's alignment is higher than the byval alignment),
|
||||
/// to ensure that Rust code never sees an underaligned pointer.
|
||||
pub fn make_indirect_byval(&mut self, byval_align: Option<Align>) {
|
||||
pub fn pass_by_stack_offset(&mut self, byval_align: Option<Align>) {
|
||||
assert!(!self.layout.is_unsized(), "used byval ABI for unsized layout");
|
||||
self.make_indirect();
|
||||
match self.mode {
|
||||
|
@ -879,8 +879,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
|
|||
{
|
||||
if abi == spec::abi::Abi::X86Interrupt {
|
||||
if let Some(arg) = self.args.first_mut() {
|
||||
// FIXME(pcwalton): This probably should use the x86 `byval` ABI...
|
||||
arg.make_indirect_byval(None);
|
||||
arg.pass_by_stack_offset(None);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ where
|
|||
align_4
|
||||
};
|
||||
|
||||
arg.make_indirect_byval(Some(byval_align));
|
||||
arg.pass_by_stack_offset(Some(byval_align));
|
||||
} else {
|
||||
arg.extend_integer_width_to(32);
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ where
|
|||
if is_arg {
|
||||
// The x86_64 ABI doesn't have any special requirements for `byval` alignment,
|
||||
// the type's alignment is always used.
|
||||
arg.make_indirect_byval(None);
|
||||
arg.pass_by_stack_offset(None);
|
||||
} else {
|
||||
// `sret` parameter thus one less integer register available
|
||||
arg.make_indirect();
|
||||
|
|
|
@ -68,7 +68,7 @@ where
|
|||
*arg_gprs_left -= needed_arg_gprs;
|
||||
|
||||
if must_use_stack {
|
||||
arg.make_indirect_byval(None);
|
||||
arg.pass_by_stack_offset(None);
|
||||
} else if is_xtensa_aggregate(arg) {
|
||||
// Aggregates which are <= max_size will be passed in
|
||||
// registers if possible, so coerce to integers.
|
||||
|
|
Loading…
Add table
Reference in a new issue