Add atomic load/store
This commit is contained in:
parent
4d763680f6
commit
6ac0f3c369
6 changed files with 136 additions and 0 deletions
48
llvm/wrap.h
48
llvm/wrap.h
|
|
@ -671,6 +671,54 @@ _w ## func (PyObject *self, PyObject *args) \
|
|||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap LLVM functions of the type
|
||||
* outtype func(intype1 arg1, intype2 arg2, const char *arg3, <unsigned/signed int> arg4)
|
||||
*/
|
||||
#define _wrap_objobjstrint2obj(func, intype1, intype2, outtype)\
|
||||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
PyObject *obj1, *obj2; \
|
||||
intype1 arg1; \
|
||||
intype2 arg2; \
|
||||
const char *arg3; \
|
||||
int arg4; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOsi", &obj1, &obj2, &arg3, &arg4)) \
|
||||
return NULL; \
|
||||
\
|
||||
arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \
|
||||
arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \
|
||||
\
|
||||
return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap LLVM functions of the type
|
||||
* outtype func(intype1 arg1, intype2 arg2, intype3, const char *arg4, <unsigned/signed int> arg5)
|
||||
*/
|
||||
#define _wrap_objobjobjstrint2obj(func, intype1, intype2, intype3, outtype)\
|
||||
static PyObject * \
|
||||
_w ## func (PyObject *self, PyObject *args) \
|
||||
{ \
|
||||
PyObject *obj1, *obj2, *obj3; \
|
||||
intype1 arg1; \
|
||||
intype2 arg2; \
|
||||
intype3 arg3; \
|
||||
const char *arg4; \
|
||||
int arg5; \
|
||||
\
|
||||
if (!PyArg_ParseTuple(args, "OOOsi", &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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue