Replace ByVal attribute with on_stack field for Indirect
This makes it clearer that only PassMode::Indirect allows ByVal
This commit is contained in:
parent
967a228208
commit
42b0b8080d
5 changed files with 102 additions and 57 deletions
|
@ -255,7 +255,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
return;
|
||||
}
|
||||
let llval = match self.fn_abi.ret.mode {
|
||||
PassMode::Ignore | PassMode::Indirect(..) => {
|
||||
PassMode::Ignore | PassMode::Indirect { .. } => {
|
||||
bx.ret_void();
|
||||
return;
|
||||
}
|
||||
|
@ -1101,7 +1101,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
// Force by-ref if we have to load through a cast pointer.
|
||||
let (mut llval, align, by_ref) = match op.val {
|
||||
Immediate(_) | Pair(..) => match arg.mode {
|
||||
PassMode::Indirect(..) | PassMode::Cast(_) => {
|
||||
PassMode::Indirect { .. } | PassMode::Cast(_) => {
|
||||
let scratch = PlaceRef::alloca(bx, arg.layout);
|
||||
op.val.store(bx, scratch);
|
||||
(scratch.llval, scratch.align, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue