@@ -331,33 +331,10 @@ macro_rules! make_mir_visitor {
331
331
self . visit_source_scope( $( & $mutability) ? * parent_scope) ;
332
332
}
333
333
if let Some ( ( callee, callsite_span) ) = inlined {
334
- let location = Location :: START ;
335
-
336
334
self . visit_span( $( & $mutability) ? * callsite_span) ;
337
-
338
- let ty:: Instance { def: callee_def, args: callee_args } = callee;
339
- match callee_def {
340
- ty:: InstanceDef :: Item ( _def_id) => { }
341
-
342
- ty:: InstanceDef :: Intrinsic ( _def_id) |
343
- ty:: InstanceDef :: VTableShim ( _def_id) |
344
- ty:: InstanceDef :: ReifyShim ( _def_id) |
345
- ty:: InstanceDef :: Virtual ( _def_id, _) |
346
- ty:: InstanceDef :: ThreadLocalShim ( _def_id) |
347
- ty:: InstanceDef :: ClosureOnceShim { call_once: _def_id, track_caller: _ } |
348
- ty:: InstanceDef :: ConstructCoroutineInClosureShim { coroutine_closure_def_id: _def_id, target_kind: _ } |
349
- ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id: _def_id, target_kind: _ } |
350
- ty:: InstanceDef :: DropGlue ( _def_id, None ) => { }
351
-
352
- ty:: InstanceDef :: FnPtrShim ( _def_id, ty) |
353
- ty:: InstanceDef :: DropGlue ( _def_id, Some ( ty) ) |
354
- ty:: InstanceDef :: CloneShim ( _def_id, ty) |
355
- ty:: InstanceDef :: FnPtrAddrShim ( _def_id, ty) => {
356
- // FIXME(eddyb) use a better `TyContext` here.
357
- self . visit_ty( $( & $mutability) ? * ty, TyContext :: Location ( location) ) ;
358
- }
359
- }
360
- self . visit_args( callee_args, location) ;
335
+ let ty:: Instance { def, args } = callee;
336
+ self . visit_instance_def( $( & $mutability) ? * def) ;
337
+ self . visit_args( & $( $mutability) ? * args, Location :: START ) ;
361
338
}
362
339
if let Some ( inlined_parent_scope) = inlined_parent_scope {
363
340
self . visit_source_scope( $( & $mutability) ? * inlined_parent_scope) ;
@@ -940,6 +917,31 @@ macro_rules! make_mir_visitor {
940
917
941
918
// Convenience methods
942
919
920
+ fn visit_instance_def( & mut self , def: $( & $mutability) ? ty:: InstanceDef <' tcx>) {
921
+ let location = Location :: START ;
922
+ match def {
923
+ ty:: InstanceDef :: Item ( _def_id) => { }
924
+
925
+ ty:: InstanceDef :: Intrinsic ( _def_id) |
926
+ ty:: InstanceDef :: VTableShim ( _def_id) |
927
+ ty:: InstanceDef :: ReifyShim ( _def_id) |
928
+ ty:: InstanceDef :: Virtual ( _def_id, _) |
929
+ ty:: InstanceDef :: ThreadLocalShim ( _def_id) |
930
+ ty:: InstanceDef :: ClosureOnceShim { call_once: _def_id, track_caller: _ } |
931
+ ty:: InstanceDef :: ConstructCoroutineInClosureShim { coroutine_closure_def_id: _def_id, target_kind: _ } |
932
+ ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id: _def_id, target_kind: _ } |
933
+ ty:: InstanceDef :: DropGlue ( _def_id, None ) => { }
934
+
935
+ ty:: InstanceDef :: FnPtrShim ( _def_id, ty) |
936
+ ty:: InstanceDef :: DropGlue ( _def_id, Some ( ty) ) |
937
+ ty:: InstanceDef :: CloneShim ( _def_id, ty) |
938
+ ty:: InstanceDef :: FnPtrAddrShim ( _def_id, ty) => {
939
+ // FIXME(eddyb) use a better `TyContext` here.
940
+ self . visit_ty( $( & $mutability * ) ? ty, TyContext :: Location ( location) ) ;
941
+ }
942
+ }
943
+ }
944
+
943
945
fn visit_location(
944
946
& mut self ,
945
947
body: & $( $mutability) ? Body <' tcx>,
0 commit comments