@@ -632,7 +632,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
632
632
pub fn make_indirect ( & mut self ) {
633
633
match self . mode {
634
634
PassMode :: Direct ( _) | PassMode :: Pair ( _, _) => {
635
- self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
635
+ self . make_indirect_force ( ) ;
636
636
}
637
637
PassMode :: Indirect { attrs : _, meta_attrs : _, on_stack : false } => {
638
638
// already indirect
@@ -642,6 +642,11 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
642
642
}
643
643
}
644
644
645
+ /// Same as make_indirect, but doesn't check the current `PassMode`.
646
+ pub fn make_indirect_force ( & mut self ) {
647
+ self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
648
+ }
649
+
645
650
/// Pass this argument indirectly, by placing it at a fixed stack offset.
646
651
/// This corresponds to the `byval` LLVM argument attribute.
647
652
/// This is only valid for sized arguments.
@@ -860,10 +865,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
860
865
}
861
866
"x86_64" => match abi {
862
867
spec:: abi:: Abi :: SysV64 { .. } => x86_64:: compute_abi_info ( cx, self ) ,
863
- spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( self ) ,
868
+ spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( cx , self ) ,
864
869
_ => {
865
870
if cx. target_spec ( ) . is_like_windows {
866
- x86_win64:: compute_abi_info ( self )
871
+ x86_win64:: compute_abi_info ( cx , self )
867
872
} else {
868
873
x86_64:: compute_abi_info ( cx, self )
869
874
}
@@ -887,7 +892,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
887
892
"csky" => csky:: compute_abi_info ( self ) ,
888
893
"mips" | "mips32r6" => mips:: compute_abi_info ( cx, self ) ,
889
894
"mips64" | "mips64r6" => mips64:: compute_abi_info ( cx, self ) ,
890
- "powerpc" => powerpc:: compute_abi_info ( self ) ,
895
+ "powerpc" => powerpc:: compute_abi_info ( cx , self ) ,
891
896
"powerpc64" => powerpc64:: compute_abi_info ( cx, self ) ,
892
897
"s390x" => s390x:: compute_abi_info ( cx, self ) ,
893
898
"msp430" => msp430:: compute_abi_info ( self ) ,
0 commit comments