def _define_nrt_incref(module, atomic_incr):
 fn_incref = module.get_or_insert_function(incref_decref_ty, name='NRT_incref')
 builder = ir.IRBuilder(fn_incref.append_basic_block())
 [ptr] = fn_incref.args
 is_null = builder.icmp_unsigned('==', ptr, cgutils.get_null_value(ptr.type))
 with cgutils.if_unlikely(builder, is_null):
  builder.ret_void()
 if _debug_print:
  cgutils.printf(builder, '*** NRT_Incref %zu [%p]\n', builder.load(ptr), ptr)
 builder.call(atomic_incr, [builder.bitcast(ptr, atomic_incr.args[0].type)])
 builder.ret_void()

def _define_nrt_incref ( module , atomic_incr ) : fn_incref = module . get_or_insert_function ( incref_decref_ty , name = 'NRT_incref' ) builder = ir . IRBuilder ( fn_incref . append_basic_block ( ) ) [ ptr ] = fn_incref . args is_null = builder . icmp_unsigned ( '==' , ptr , cgutils . get_null_value ( ptr . type ) ) with cgutils . if_unlikely ( builder , is_null ) : builder . ret_void ( ) if _debug_print : cgutils . printf ( builder , '*** NRT_Incref %zu [%p]\n' , builder . load ( ptr ) , ptr ) builder . call ( atomic_incr , [ builder . bitcast ( ptr , atomic_incr . args [ 0 ] . type ) ] ) builder . ret_void ( )
implement nrt_incref in the module .