Fix some stuff

support casting int <-> pointers in llvm_cbuilder
    assign ndarray type to fake PyArrays
This commit is contained in:
Mark Florisson 2012-09-27 16:30:14 +01:00
commit f0ad108e2c
2 changed files with 6 additions and 0 deletions

View file

@ -1057,6 +1057,11 @@ class IntegerValue(OperatorMixin):
return self._temp(self.parent.builder.sext(self.value, ty))
else:
return self._temp(self.parent.builder.trunc(self.value, ty))
elif _is_pointer(ty) and _is_int(self.type):
return self._temp(self.parent.builder.inttoptr(self.value, ty))
elif _is_int(ty) and _is_pointer(self.type):
return self._temp(self.parent.builder.ptrtoint(self.value, ty))
raise CastError(self.type, ty)
class RealValue(OperatorMixin):

View file

@ -14,6 +14,7 @@ float = Type.float()
double = Type.double()
npy_intp = minitypes.npy_intp.to_llvm(numba.decorators.context)
py_ssize_t = minitypes.Py_ssize_t.to_llvm(numba.decorators.context)
# pointers