@@ -716,8 +716,14 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>(
716
716
def : InstanceDef :: Virtual ( _, idx) ,
717
717
..
718
718
} ) => {
719
- let nop_inst = fx. bcx . ins ( ) . nop ( ) ;
720
- fx. add_comment ( nop_inst, format ! ( "virtual call; self arg pass mode: {:?}" , get_pass_mode( fx. tcx, args[ 0 ] . layout( ) ) ) ) ;
719
+ #[ cfg( debug_assertions) ]
720
+ {
721
+ let nop_inst = fx. bcx . ins ( ) . nop ( ) ;
722
+ fx. add_comment (
723
+ nop_inst,
724
+ format ! ( "virtual call; self arg pass mode: {:?}" , get_pass_mode( fx. tcx, args[ 0 ] . layout( ) ) ) ,
725
+ ) ;
726
+ }
721
727
let ( ptr, method) = crate :: vtable:: get_ptr_and_method_ref ( fx, args[ 0 ] , idx) ;
722
728
( Some ( method) , Single ( ptr) , true )
723
729
}
@@ -727,8 +733,11 @@ pub fn codegen_call_inner<'a, 'tcx: 'a>(
727
733
728
734
// Indirect call
729
735
None => {
730
- let nop_inst = fx. bcx . ins ( ) . nop ( ) ;
731
- fx. add_comment ( nop_inst, "indirect call" ) ;
736
+ #[ cfg( debug_assertions) ]
737
+ {
738
+ let nop_inst = fx. bcx . ins ( ) . nop ( ) ;
739
+ fx. add_comment ( nop_inst, "indirect call" ) ;
740
+ }
732
741
let func = trans_operand ( fx, func. expect ( "indirect call without func Operand" ) )
733
742
. load_scalar ( fx) ;
734
743
(
0 commit comments