Merge branch 'master' of github.com:llvmpy/llvmpy
This commit is contained in:
commit
505d280fe0
3 changed files with 35 additions and 0 deletions
|
|
@ -778,6 +778,7 @@ _wrap_objstrint2obj(LLVMBuildFence, LLVMBuilderRef, LLVMValueRef)
|
||||||
/* Miscellaneous instructions */
|
/* Miscellaneous instructions */
|
||||||
|
|
||||||
_wrap_objobjintstr2obj(LLVMBuildGetResult, LLVMBuilderRef, LLVMValueRef, LLVMValueRef)
|
_wrap_objobjintstr2obj(LLVMBuildGetResult, LLVMBuilderRef, LLVMValueRef, LLVMValueRef)
|
||||||
|
_wrap_objobjobjintstr2obj(LLVMBuildInsertValue, LLVMBuilderRef, LLVMValueRef, LLVMValueRef, LLVMValueRef)
|
||||||
_wrap_objobjstr2obj(LLVMBuildPhi, LLVMBuilderRef, LLVMTypeRef, LLVMValueRef)
|
_wrap_objobjstr2obj(LLVMBuildPhi, LLVMBuilderRef, LLVMTypeRef, LLVMValueRef)
|
||||||
_wrap_objobjliststr2obj(LLVMBuildCall, LLVMBuilderRef, LLVMValueRef, LLVMValueRef, LLVMValueRef)
|
_wrap_objobjliststr2obj(LLVMBuildCall, LLVMBuilderRef, LLVMValueRef, LLVMValueRef, LLVMValueRef)
|
||||||
_wrap_objobjobjobjstr2obj(LLVMBuildSelect, LLVMBuilderRef, LLVMValueRef, LLVMValueRef, LLVMValueRef, LLVMValueRef)
|
_wrap_objobjobjobjstr2obj(LLVMBuildSelect, LLVMBuilderRef, LLVMValueRef, LLVMValueRef, LLVMValueRef, LLVMValueRef)
|
||||||
|
|
@ -1764,6 +1765,7 @@ static PyMethodDef core_methods[] = {
|
||||||
|
|
||||||
/* Miscellaneous instructions */
|
/* Miscellaneous instructions */
|
||||||
_method( LLVMBuildGetResult )
|
_method( LLVMBuildGetResult )
|
||||||
|
_method( LLVMBuildInsertValue )
|
||||||
_method( LLVMBuildPhi )
|
_method( LLVMBuildPhi )
|
||||||
_method( LLVMBuildCall )
|
_method( LLVMBuildCall )
|
||||||
_method( LLVMBuildSelect )
|
_method( LLVMBuildSelect )
|
||||||
|
|
|
||||||
|
|
@ -1959,6 +1959,13 @@ class Builder(object):
|
||||||
# obsolete synonym for extract_value
|
# obsolete synonym for extract_value
|
||||||
getresult = extract_value
|
getresult = extract_value
|
||||||
|
|
||||||
|
def insert_value(self, retval, rhs, idx, name=""):
|
||||||
|
check_is_value(retval)
|
||||||
|
check_is_value(rhs)
|
||||||
|
return _make_value(
|
||||||
|
_core.LLVMBuildInsertValue(self.ptr, retval.ptr, rhs.ptr, idx,
|
||||||
|
name))
|
||||||
|
|
||||||
def phi(self, ty, name=""):
|
def phi(self, ty, name=""):
|
||||||
check_is_type(ty)
|
check_is_type(ty)
|
||||||
return _make_value(_core.LLVMBuildPhi(self.ptr, ty.ptr, name))
|
return _make_value(_core.LLVMBuildPhi(self.ptr, ty.ptr, name))
|
||||||
|
|
|
||||||
26
llvm/wrap.h
26
llvm/wrap.h
|
|
@ -659,6 +659,32 @@ _w ## func (PyObject *self, PyObject *args) \
|
||||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)) ; \
|
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)) ; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrap LLVM functions of the type
|
||||||
|
* outtype func(intype1 arg1, intype2 arg2, intype3, int arg3, const char *arg4)
|
||||||
|
*/
|
||||||
|
#define _wrap_objobjobjintstr2obj(func, intype1, intype2, intype3, outtype) \
|
||||||
|
static PyObject * \
|
||||||
|
_w ## func (PyObject *self, PyObject *args) \
|
||||||
|
{ \
|
||||||
|
PyObject *obj1, *obj2, *obj3; \
|
||||||
|
intype1 arg1; \
|
||||||
|
intype2 arg2; \
|
||||||
|
intype3 arg3; \
|
||||||
|
int arg4; \
|
||||||
|
const char *arg5; \
|
||||||
|
\
|
||||||
|
if (!PyArg_ParseTuple(args, "OOOis", &obj1, &obj2, &obj3, &arg4, \
|
||||||
|
&arg5)) \
|
||||||
|
return NULL; \
|
||||||
|
\
|
||||||
|
arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \
|
||||||
|
arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \
|
||||||
|
arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \
|
||||||
|
\
|
||||||
|
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)) ; \
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrap LLVM functions of the type
|
* Wrap LLVM functions of the type
|
||||||
* outtype func(intype1 arg1, intype2 arg2, intype3 arg3, const char *arg4)
|
* outtype func(intype1 arg1, intype2 arg2, intype3 arg3, const char *arg4)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue