@@ -902,31 +902,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
902
902
// The arguments we'll be passing. Plus one to account for outptr, if used.
903
903
let arg_count = fn_abi. args . len ( ) + fn_abi. ret . is_indirect ( ) as usize ;
904
904
905
- if matches ! ( intrinsic, Some ( ty:: IntrinsicDef { name: sym:: caller_location, .. } ) ) {
906
- return if let Some ( target) = target {
907
- let location =
908
- self . get_caller_location ( bx, mir:: SourceInfo { span : fn_span, ..source_info } ) ;
909
-
910
- let mut llargs = Vec :: with_capacity ( arg_count) ;
911
- let ret_dest = self . make_return_dest (
912
- bx,
913
- destination,
914
- & fn_abi. ret ,
915
- & mut llargs,
916
- intrinsic,
917
- Some ( target) ,
918
- ) ;
919
- assert_eq ! ( llargs, [ ] ) ;
920
- if let ReturnDest :: IndirectOperand ( tmp, _) = ret_dest {
921
- location. val . store ( bx, tmp) ;
922
- }
923
- self . store_return ( bx, ret_dest, & fn_abi. ret , location. immediate ( ) ) ;
924
- helper. funclet_br ( self , bx, target, mergeable_succ)
925
- } else {
926
- MergingSucc :: False
927
- } ;
928
- }
929
-
930
905
let instance = match intrinsic {
931
906
None => instance,
932
907
Some ( intrinsic) => {
@@ -971,6 +946,18 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
971
946
} )
972
947
. collect ( ) ;
973
948
949
+ if matches ! ( intrinsic, ty:: IntrinsicDef { name: sym:: caller_location, .. } ) {
950
+ let location = self
951
+ . get_caller_location ( bx, mir:: SourceInfo { span : fn_span, ..source_info } ) ;
952
+
953
+ assert_eq ! ( llargs, [ ] ) ;
954
+ if let ReturnDest :: IndirectOperand ( tmp, _) = ret_dest {
955
+ location. val . store ( bx, tmp) ;
956
+ }
957
+ self . store_return ( bx, ret_dest, & fn_abi. ret , location. immediate ( ) ) ;
958
+ return helper. funclet_br ( self , bx, target. unwrap ( ) , mergeable_succ) ;
959
+ }
960
+
974
961
let instance = * instance. as_ref ( ) . unwrap ( ) ;
975
962
match Self :: codegen_intrinsic_call ( bx, instance, fn_abi, & args, dest, span) {
976
963
Ok ( ( ) ) => {
0 commit comments