예제 #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)