@@ -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) ;
@@ -941,6 +918,31 @@ macro_rules! make_mir_visitor {
941
918
942
919
// Convenience methods
943
920
921
+ fn visit_instance_def( & mut self , def: $( & $mutability) ? ty:: InstanceDef <' tcx>) {
922
+ let location = Location :: START ;
923
+ match def {
924
+ ty:: InstanceDef :: Item ( _def_id) => { }
925
+
926
+ ty:: InstanceDef :: Intrinsic ( _def_id) |
927
+ ty:: InstanceDef :: VTableShim ( _def_id) |
928
+ ty:: InstanceDef :: ReifyShim ( _def_id) |
929
+ ty:: InstanceDef :: Virtual ( _def_id, _) |
930
+ ty:: InstanceDef :: ThreadLocalShim ( _def_id) |
931
+ ty:: InstanceDef :: ClosureOnceShim { call_once: _def_id, track_caller: _ } |
932
+ ty:: InstanceDef :: ConstructCoroutineInClosureShim { coroutine_closure_def_id: _def_id, target_kind: _ } |
933
+ ty:: InstanceDef :: CoroutineKindShim { coroutine_def_id: _def_id, target_kind: _ } |
934
+ ty:: InstanceDef :: DropGlue ( _def_id, None ) => { }
935
+
936
+ ty:: InstanceDef :: FnPtrShim ( _def_id, ty) |
937
+ ty:: InstanceDef :: DropGlue ( _def_id, Some ( ty) ) |
938
+ ty:: InstanceDef :: CloneShim ( _def_id, ty) |
939
+ ty:: InstanceDef :: FnPtrAddrShim ( _def_id, ty) => {
940
+ // FIXME(eddyb) use a better `TyContext` here.
941
+ self . visit_ty( $( & $mutability * ) ? ty, TyContext :: Location ( location) ) ;
942
+ }
943
+ }
944
+ }
945
+
944
946
fn visit_location(
945
947
& mut self ,
946
948
body: & $( $mutability) ? Body <' tcx>,
0 commit comments