def get_argument_value(self, builder, ty, val): """ Argument representation to local value representation """ if ty == types.boolean: return builder.trunc(val, self.get_value_type(ty)) elif cgutils.is_struct_ptr(val.type): return builder.load(val) return val
def __init__(self, context, builder, args, steps, i, argtype): # Get data p = builder.gep(args, [context.get_constant(types.intp, i)]) if cgutils.is_struct_ptr(argtype): self.byref = True self.data = builder.bitcast(builder.load(p), argtype) else: self.byref = False self.data = builder.bitcast(builder.load(p), Type.pointer(argtype)) # Get step p = builder.gep(steps, [context.get_constant(types.intp, i)]) self.step = builder.load(p) self.builder = builder
def __init__(self, context, builder, args, steps, i, argtype): # Get data p = builder.gep(args, [context.get_constant(types.intp, i)]) if cgutils.is_struct_ptr(argtype): self.byref = True self.data = builder.bitcast(builder.load(p), argtype) else: self.byref = False self.data = builder.bitcast(builder.load(p), Type.pointer(argtype)) # Get step p = builder.gep(steps, [context.get_constant(types.intp, i)]) abisize = context.get_constant(types.intp, context.get_abi_sizeof(argtype)) self.step = builder.load(p) self.is_unit_strided = builder.icmp(ICMP_EQ, abisize, self.step) self.builder = builder