@@ -639,7 +639,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
639639 pub fn make_indirect ( & mut self ) {
640640 match self . mode {
641641 PassMode :: Direct ( _) | PassMode :: Pair ( _, _) => {
642- self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
642+ self . make_indirect_force ( ) ;
643643 }
644644 PassMode :: Indirect { attrs : _, meta_attrs : _, on_stack : false } => {
645645 // already indirect
@@ -649,6 +649,11 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
649649 }
650650 }
651651
652+ /// Same as make_indirect, but doesn't check the current `PassMode`.
653+ pub fn make_indirect_force ( & mut self ) {
654+ self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
655+ }
656+
652657 /// Pass this argument indirectly, by placing it at a fixed stack offset.
653658 /// This corresponds to the `byval` LLVM argument attribute.
654659 /// This is only valid for sized arguments.
@@ -868,10 +873,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
868873 }
869874 "x86_64" => match abi {
870875 spec:: abi:: Abi :: SysV64 { .. } => x86_64:: compute_abi_info ( cx, self ) ,
871- spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( self ) ,
876+ spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( cx , self ) ,
872877 _ => {
873878 if cx. target_spec ( ) . is_like_windows {
874- x86_win64:: compute_abi_info ( self )
879+ x86_win64:: compute_abi_info ( cx , self )
875880 } else {
876881 x86_64:: compute_abi_info ( cx, self )
877882 }
@@ -895,7 +900,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
895900 "csky" => csky:: compute_abi_info ( self ) ,
896901 "mips" | "mips32r6" => mips:: compute_abi_info ( cx, self ) ,
897902 "mips64" | "mips64r6" => mips64:: compute_abi_info ( cx, self ) ,
898- "powerpc" => powerpc:: compute_abi_info ( self ) ,
903+ "powerpc" => powerpc:: compute_abi_info ( cx , self ) ,
899904 "powerpc64" => powerpc64:: compute_abi_info ( cx, self ) ,
900905 "s390x" => s390x:: compute_abi_info ( cx, self ) ,
901906 "msp430" => msp430:: compute_abi_info ( self ) ,
0 commit comments