@@ -642,7 +642,7 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
642
642
pub fn make_indirect ( & mut self ) {
643
643
match self . mode {
644
644
PassMode :: Direct ( _) | PassMode :: Pair ( _, _) => {
645
- self . mode = Self :: indirect_pass_mode ( & self . layout ) ;
645
+ self . make_indirect_force ( ) ;
646
646
}
647
647
PassMode :: Indirect { attrs : _, meta_attrs : _, on_stack : false } => {
648
648
// already indirect
@@ -652,6 +652,11 @@ impl<'a, Ty> ArgAbi<'a, Ty> {
652
652
}
653
653
}
654
654
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
+
655
660
/// Pass this argument indirectly, by placing it at a fixed stack offset.
656
661
/// This corresponds to the `byval` LLVM argument attribute.
657
662
/// This is only valid for sized arguments.
@@ -871,10 +876,10 @@ impl<'a, Ty> FnAbi<'a, Ty> {
871
876
}
872
877
"x86_64" => match abi {
873
878
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 ) ,
875
880
_ => {
876
881
if cx. target_spec ( ) . is_like_windows {
877
- x86_win64:: compute_abi_info ( self )
882
+ x86_win64:: compute_abi_info ( cx , self )
878
883
} else {
879
884
x86_64:: compute_abi_info ( cx, self )
880
885
}
@@ -898,7 +903,7 @@ impl<'a, Ty> FnAbi<'a, Ty> {
898
903
"csky" => csky:: compute_abi_info ( self ) ,
899
904
"mips" | "mips32r6" => mips:: compute_abi_info ( cx, self ) ,
900
905
"mips64" | "mips64r6" => mips64:: compute_abi_info ( cx, self ) ,
901
- "powerpc" => powerpc:: compute_abi_info ( self ) ,
906
+ "powerpc" => powerpc:: compute_abi_info ( cx , self ) ,
902
907
"powerpc64" => powerpc64:: compute_abi_info ( cx, self ) ,
903
908
"s390x" => s390x:: compute_abi_info ( cx, self ) ,
904
909
"msp430" => msp430:: compute_abi_info ( self ) ,
0 commit comments