示例#1
0
        def emit(builder):
            v = llvm.ConstNull(self.llvm_type)
            for i, e in enumerate(elements):
                llvm_i = _index(builder, const_index(i))
                cast_e, _ = cast(e, self.element_type).emit(builder)
                v = llvm.BuildInsertElement(builder, v, cast_e, llvm_i, "v.init")

            return v, self
示例#2
0
 def __call__(self, v):
     """Nicer equivalent to ``cast(v, Type)``"""
     from nitrous.lib import cast
     return cast(v, self)
示例#3
0
 def x(y):
     return cast(y, Double)
示例#4
0
 def __call__(self, v):
     """Nicer equivalent to ``cast(v, Type)``"""
     from nitrous.lib import cast
     return cast(v, self)
示例#5
0
 def int_to_long(a):
     return cast(a, Byte)
示例#6
0
 def div_double(a, b):
     return cast(a, Double) / b
示例#7
0
 def int_to_long(a):
     return cast(a, Int)
示例#8
0
 def div_long(a, b):
     return a / cast(b, Long)
示例#9
0
 def int_to_long(a):
     return cast(a, Long)
示例#10
0
 def float_to_double(a):
     return cast(a, Double)
示例#11
0
 def double_to_float(a):
     return cast(a, Float)
示例#12
0
 def x(y):
     return cast(y, Double)