def pack_array(builder, values): n = len(values) ty = values[0].type ary = Constant.undef(Type.array(ty, n)) for i, v in enumerate(values): ary = builder.insert_value(ary, v, i) return ary
def pack_array(builder, values): n = len(values) ty = values[0].type ary = Constant.undef(Type.array(ty, n)) for i, v in enumerate(values): ary = builder.insert_value(ary, v, i) return ary
def make_anonymous_struct(builder, values): """ Create an anonymous struct constant containing the given LLVM *values*. """ struct_type = Type.struct([v.type for v in values]) struct_val = Constant.undef(struct_type) for i, v in enumerate(values): struct_val = builder.insert_value(struct_val, v, i) return struct_val
def make_anonymous_struct(builder, values): """ Create an anonymous struct containing the given LLVM *values*. """ struct_type = Type.struct([v.type for v in values]) struct_val = Constant.undef(struct_type) for i, v in enumerate(values): struct_val = builder.insert_value(struct_val, v, i) return struct_val
def pack_array(builder, values, ty=None): """ Pack an array of values. *ty* should be given if the array may be empty, in which case the type can't be inferred from the values. """ n = len(values) if ty is None: ty = values[0].type ary = Constant.undef(Type.array(ty, n)) for i, v in enumerate(values): ary = builder.insert_value(ary, v, i) return ary
def pack_array(builder, values, ty=None): """ Pack an array of values. *ty* should be given if the array may be empty, in which case the type can't be inferred from the values. """ n = len(values) if ty is None: ty = values[0].type ary = Constant.undef(Type.array(ty, n)) for i, v in enumerate(values): ary = builder.insert_value(ary, v, i) return ary
def get_constant_undef(self, ty): lty = self.get_value_type(ty) return Constant.undef(lty)
def get_constant_undef(self, ty): lty = self.get_value_type(ty) return Constant.undef(lty)