@@ -642,7 +642,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
642642 pub fn make_indirect ( & mut self ) {
643643 match self . mode {
644644 PassMode :: Direct ( _) | PassMode :: Pair ( _, _) => {
645- self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
645+ self . make_indirect_force ( ) ;
646646 }
647647 PassMode :: Indirect { attrs : _, meta_attrs : _, on_stack : false } => {
648648 // already indirect
@@ -652,6 +652,11 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
652652 }
653653 }
654654
655+ /// Same as make_indirect, but doesn't check the current `PassMode`.
656+ pub fn make_indirect_force ( & mut self ) {
657+ self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
658+ }
659+
655660 /// Pass this argument indirectly, by placing it at a fixed stack offset.
656661 /// This corresponds to the `byval` LLVM argument attribute.
657662 /// This is only valid for sized arguments.
@@ -871,10 +876,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
871876 }
872877 "x86_64" => match abi {
873878 spec:: abi:: Abi :: SysV64 { .. } => x86_64:: compute_abi_info ( cx, self ) ,
874- spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( self ) ,
879+ spec:: abi:: Abi :: Win64 { .. } => x86_win64:: compute_abi_info ( cx , self ) ,
875880 _ => {
876881 if cx. target_spec ( ) . is_like_windows {
877- x86_win64:: compute_abi_info ( self )
882+ x86_win64:: compute_abi_info ( cx , self )
878883 } else {
879884 x86_64:: compute_abi_info ( cx, self )
880885 }
@@ -898,7 +903,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
898903 "csky" => csky:: compute_abi_info ( self ) ,
899904 "mips" | "mips32r6" => mips:: compute_abi_info ( cx, self ) ,
900905 "mips64" | "mips64r6" => mips64:: compute_abi_info ( cx, self ) ,
901- "powerpc" => powerpc:: compute_abi_info ( self ) ,
906+ "powerpc" => powerpc:: compute_abi_info ( cx , self ) ,
902907 "powerpc64" => powerpc64:: compute_abi_info ( cx, self ) ,
903908 "s390x" => s390x:: compute_abi_info ( cx, self ) ,
904909 "msp430" => msp430:: compute_abi_info ( self ) ,
0 commit comments