'Extract the generator structure pointer from a generator *obj*
(a _dynfunc.Generator instance).'

def to_native_generator(self, obj, typ):

    gen_ptr_ty = Type.pointer(self.context.get_data_type(typ))
    value = self.context.get_generator_state(self.builder, obj, gen_ptr_ty)
    return NativeValue(value)
