def create_nrt_module(ctx):
 codegen = ctx.codegen()
 library = codegen.create_library('nrt')
 ir_mod = library.create_ir_module('nrt_module')
 atomic_inc = _define_atomic_inc_dec(ir_mod, 'add', ordering='monotonic')
 atomic_dec = _define_atomic_inc_dec(ir_mod, 'sub', ordering='monotonic')
 _define_atomic_cas(ir_mod, ordering='monotonic')
 _define_nrt_meminfo_data(ir_mod)
 _define_nrt_incref(ir_mod, atomic_inc)
 _define_nrt_decref(ir_mod, atomic_dec)
 _define_nrt_unresolved_abort(ctx, ir_mod)
 return (ir_mod, library)

def create_nrt_module ( ctx ) : codegen = ctx . codegen ( ) library = codegen . create_library ( 'nrt' ) ir_mod = library . create_ir_module ( 'nrt_module' ) atomic_inc = _define_atomic_inc_dec ( ir_mod , 'add' , ordering = 'monotonic' ) atomic_dec = _define_atomic_inc_dec ( ir_mod , 'sub' , ordering = 'monotonic' ) _define_atomic_cas ( ir_mod , ordering = 'monotonic' ) _define_nrt_meminfo_data ( ir_mod ) _define_nrt_incref ( ir_mod , atomic_inc ) _define_nrt_decref ( ir_mod , atomic_dec ) _define_nrt_unresolved_abort ( ctx , ir_mod ) return ( ir_mod , library )
create an ir module defining the llvm nrt functions .