diff --git a/llvm/_core.c b/llvm/_core.c index a824579..2da9cf2 100644 --- a/llvm/_core.c +++ b/llvm/_core.c @@ -67,9 +67,18 @@ _wLLVMModuleCreateWithName(PyObject *self, PyObject *args) const char *s; LLVMModuleRef module; +#ifdef LLVM_PY_USE_PYCAPSULE + PyObject *s_; + if (!PyArg_ParseTuple(args, "U:LLVMModuleCreateWithName", &s_)) { + return NULL; + } + + s = PyUnicode_AS_DATA(s_); +#else if (!PyArg_ParseTuple(args, "s", &s)) return NULL; - +#endif + module = LLVMModuleCreateWithName(s); return ctor_LLVMModuleRef(module); } @@ -430,9 +439,18 @@ _wLLVMConstString(PyObject *self, PyObject *args) const char *s; int dont_null_terminate; LLVMValueRef val; + +#ifdef LLVM_PY_USE_PYCAPSULE + PyObject *s_; + if (!PyArg_ParseTuple(args, "Ui:LLVMConstString", &s_, &dont_null_terminate)) { + return NULL; + } + s = PyUnicode_AS_DATA(s_); +#else if (!PyArg_ParseTuple(args, "si", &s, &dont_null_terminate)) return NULL; +#endif val = LLVMConstString(s, strlen(s), dont_null_terminate); return ctor_LLVMValueRef(val); @@ -648,8 +666,17 @@ _wLLVMBuildInvoke(PyObject *self, PyObject *args) LLVMBasicBlockRef then_blk, catch_blk; LLVMValueRef inst; +#ifdef LLVM_PY_USE_PYCAPSULE + PyObject *name_; + if (!PyArg_ParseTuple(args, "OOOOOU:LLVMBuildInvoke", &obj1, &obj2, &obj3, &obj4, &obj5, &name_)) { + return NULL; + } + + name = PyUnicode_AS_DATA(name_); +#else if (!PyArg_ParseTuple(args, "OOOOOs", &obj1, &obj2, &obj3, &obj4, &obj5, &name)) return NULL; +#endif #ifdef LLVM_PY_USE_PYCAPSULE builder = (LLVMBuilderRef) PyCapsule_GetPointer(obj1, NULL); @@ -764,9 +791,18 @@ _wLLVMCreateMemoryBufferWithContentsOfFile(PyObject *self, PyObject *args) char *outmsg; PyObject *ret; +#ifdef LLVM_PY_USE_PYCAPSULE + PyObject *path_; + if (!PyArg_ParseTuple(args, "U:LLVMCreateMemoryBufferWithContentsOfFile", &path_)) { + return NULL; + } + + path = PyUnicode_AS_DATA(path_); +#else if (!PyArg_ParseTuple(args, "s", &path)) return NULL; - +#endif + if (!LLVMCreateMemoryBufferWithContentsOfFile(path, &ref, &outmsg)) { ret = ctor_LLVMMemoryBufferRef(ref); } else { @@ -1217,14 +1253,22 @@ _wrap_objintlist2obj(LLVMGetIntrinsic, LLVMModuleRef, LLVMTypeRef, static PyObject * _wLLVMLoadLibraryPermanently(PyObject *self, PyObject *args) { - // XXX TODO: Figure out why this is segfaulting const char *filename; char *outmsg; PyObject *ret; +#ifdef LLVM_PY_USE_PYCAPSULE + PyObject *filename_; + if (!PyArg_ParseTuple(args, "U:LLVMLoadLibraryPermanently", &filename_)) { + return NULL; + } + + filename = PyUnicode_AS_DATA(filename_); +#else if (!PyArg_ParseTuple(args, "s", &filename)) { return NULL; } +#endif outmsg = 0; if (!LLVMLoadLibraryPermanently(filename, &outmsg)) { diff --git a/llvm/wrap.h b/llvm/wrap.h index 191566d..3467ae0 100644 --- a/llvm/wrap.h +++ b/llvm/wrap.h @@ -173,20 +173,21 @@ _w ## func (PyObject *self, PyObject *args) \ * Wrap LLVM functions of the type * outtype func(intype1 arg1, intype2 arg2) */ -#define _wrap_objobj2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 arg2; \ - \ - if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \ - return NULL; \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2)); \ +#define _wrap_objobj2obj(func, intype1, intype2, outtype)\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2; \ + intype1 arg1; \ + intype2 arg2; \ + \ + if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2)); \ } /** @@ -203,8 +204,9 @@ _w ## func (PyObject *self, PyObject *args) \ \ if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \ return NULL; \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL);\ \ func (arg1, arg2); \ Py_RETURN_NONE; \ @@ -224,7 +226,8 @@ _w ## func (PyObject *self, PyObject *args) \ \ if (!PyArg_ParseTuple(args, "OI", &obj1, &arg2)) \ return NULL; \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ \ return ctor_ ## outtype ( func (arg1, arg2)); \ } @@ -234,22 +237,22 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, intype3 arg3) */ #define _wrap_objobjobj2obj(func, intype1, intype2, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 arg3; \ - \ - if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \ - 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)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + \ + if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \ + 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)); \ } /** @@ -257,23 +260,23 @@ _w ## func (PyObject *self, PyObject *args) \ * void func(intype1 arg1, intype2 arg2, intype3 arg3) */ #define _wrap_objobjobj2none(func, intype1, intype2, intype3) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 arg3; \ - \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + \ if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - \ - func (arg1, arg2, arg3); \ - Py_RETURN_NONE; \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + \ + func (arg1, arg2, arg3); \ + Py_RETURN_NONE; \ } /** @@ -281,21 +284,21 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func( arg1, intype2 arg2, intype3 arg3) */ #define _wrap_intobjobj2obj(func, intype2, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - unsigned int arg1; \ - PyObject *obj2, *obj3; \ - intype2 arg2; \ - intype3 arg3; \ - \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + unsigned int arg1; \ + PyObject *obj2, *obj3; \ + intype2 arg2; \ + intype3 arg3; \ + \ if (!PyArg_ParseTuple(args, "IOO", &arg1, &obj2, &obj3)) \ - return NULL; \ - \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ + return NULL; \ + \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ } /** @@ -303,21 +306,21 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(enum_intype1 arg1, intype2 arg2, intype3 arg3) */ #define _wrap_enumobjobj2obj(func, intype1, intype2, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - intype1 arg1; \ - PyObject *obj2, *obj3; \ - intype2 arg2; \ - intype3 arg3; \ - \ - if (!PyArg_ParseTuple(args, "IOO", &arg1, &obj2, &obj3)) \ - return NULL; \ - \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + intype1 arg1; \ + PyObject *obj2, *obj3; \ + intype2 arg2; \ + intype3 arg3; \ + \ + if (!PyArg_ParseTuple(args, "IOO", &arg1, &obj2, &obj3)) \ + return NULL; \ + \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ } /** @@ -328,11 +331,14 @@ _w ## func (PyObject *self, PyObject *args) \ static PyObject * \ _w ## func (PyObject *self, PyObject *args) \ { \ + PyObject *arg1_; \ const char *arg1; \ \ - if (!PyArg_ParseTuple(args, "s", &arg1)) \ + if (!PyArg_ParseTuple(args, "U", &arg1_)) \ return NULL; \ \ + arg1 = PyUnicode_AS_DATA(arg1_); \ + \ return ctor_ ## outtype ( func (arg1)); \ } @@ -363,7 +369,7 @@ _w ## func (PyObject *self, PyObject *args) \ if (!(arg1 = ( intype1 )get_object_arg(args))) \ return NULL; \ \ - return PyBytes_FromString( func (arg1)); \ + return PyBytes_FromString( func (arg1)); \ } /** @@ -391,14 +397,15 @@ _w ## func (PyObject *self, PyObject *args) \ static PyObject * \ _w ## func (PyObject *self, PyObject *args) \ { \ - PyObject *obj1; \ + PyObject *obj1, *arg2_; \ const char *arg2; \ intype1 arg1; \ \ - if (!PyArg_ParseTuple(args, "Os", &obj1, &arg2)) \ + if (!PyArg_ParseTuple(args, "OU", &obj1, &arg2_)) \ return NULL; \ \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ + arg2 = PyUnicode_AS_DATA(arg2_); \ \ func (arg1, arg2); \ Py_RETURN_NONE; \ @@ -412,14 +419,15 @@ _w ## func (PyObject *self, PyObject *args) \ static PyObject * \ _w ## func (PyObject *self, PyObject *args) \ { \ - PyObject *obj1; \ + PyObject *obj1, *arg2_; \ const char *arg2; \ intype1 arg1; \ \ - if (!PyArg_ParseTuple(args, "Os", &obj1, &arg2)) \ + if (!PyArg_ParseTuple(args, "OU", &obj1, &arg2_)) \ return NULL; \ \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ + arg2 = PyUnicode_AS_DATA(arg2_); \ \ return ctor_ ## outtype ( func (arg1, arg2)); \ } @@ -439,7 +447,7 @@ _w ## func (PyObject *self, PyObject *args) \ if (!PyArg_ParseTuple(args, "Oi", &obj1, &arg2)) \ return NULL; \ \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ \ func (arg1, arg2); \ Py_RETURN_NONE; \ @@ -460,7 +468,7 @@ _w ## func (PyObject *self, PyObject *args) \ if (!PyArg_ParseTuple(args, "Oi", &obj1, &arg2)) \ return NULL; \ \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL);\ \ func (arg1, arg2); \ Py_RETURN_NONE; \ @@ -471,21 +479,22 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, const char *arg3) */ #define _wrap_objobjstr2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 arg2; \ - const char *arg3; \ - \ - if (!PyArg_ParseTuple(args, "OOs", &obj1, &obj2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *arg3_; \ + intype1 arg1; \ + intype2 arg2; \ + const char *arg3; \ + \ + if (!PyArg_ParseTuple(args, "OOU", &obj1, &obj2, &arg3_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = PyUnicode_AS_DATA(arg3_); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ } /** @@ -493,21 +502,21 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, int arg3) */ #define _wrap_objobjint2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 arg2; \ - int arg3; \ - \ - if (!PyArg_ParseTuple(args, "OOi", &obj1, &obj2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2; \ + intype1 arg1; \ + intype2 arg2; \ + int arg3; \ + \ + if (!PyArg_ParseTuple(args, "OOi", &obj1, &obj2, &arg3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)) ; \ } /** @@ -515,64 +524,64 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, unsigned long long arg3) */ #define _wrap_objobjull2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 arg2; \ - unsigned long long arg3; \ - \ - if (!PyArg_ParseTuple(args, "OOK", &obj1, &obj2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2; \ + intype1 arg1; \ + intype2 arg2; \ + unsigned long long arg3; \ + \ + if (!PyArg_ParseTuple(args, "OOK", &obj1, &obj2, &arg3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)) ; \ } /** * Wrap LLVM functions of the type * void func(intype1 arg1, arg2, arg3) */ -#define _wrap_objintint2none(func, intype1) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1; \ - intype1 arg1; \ - int arg2, arg3; \ - \ - if (!PyArg_ParseTuple(args, "Oii", &obj1, &arg2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - \ - func (arg1, arg2, arg3); \ - Py_RETURN_NONE; \ +#define _wrap_objintint2none(func, intype1) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1; \ + intype1 arg1; \ + int arg2, arg3; \ + \ + if (!PyArg_ParseTuple(args, "Oii", &obj1, &arg2, &arg3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + \ + func (arg1, arg2, arg3); \ + Py_RETURN_NONE; \ } /** * Wrap LLVM functions of the type * void func(intype1 arg1, arg2, enum_intype3 arg3) */ -#define _wrap_objintenum2none(func, intype1, intype3) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1; \ - intype1 arg1; \ - int arg2; \ - intype3 arg3; \ - \ +#define _wrap_objintenum2none(func, intype1, intype3) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1; \ + intype1 arg1; \ + int arg2; \ + intype3 arg3; \ + \ if (!PyArg_ParseTuple(args, "Oii", &obj1, &arg2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - \ - func (arg1, arg2, arg3); \ - Py_RETURN_NONE; \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + \ + func (arg1, arg2, arg3); \ + Py_RETURN_NONE; \ } /** @@ -580,21 +589,22 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, const char *arg2, intype3 arg3) */ #define _wrap_objstrobj2obj(func, intype1, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj3; \ - intype1 arg1; \ - const char *arg2; \ - intype3 arg3; \ - \ - if (!PyArg_ParseTuple(args, "OsO", &obj1, &arg2, &obj3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj3, *arg2_; \ + intype1 arg1; \ + const char *arg2; \ + intype3 arg3; \ + \ + if (!PyArg_ParseTuple(args, "OUO", &obj1, &arg2_, &obj3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = PyUnicode_AS_DATA(arg2_); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3)); \ } @@ -602,47 +612,49 @@ _w ## func (PyObject *self, PyObject *args) \ * Wrap LLVM functions of the type * outtype func(intype1 arg1, intype2 arg2, int arg3, const char *arg4) */ -#define _wrap_objobjintstr2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 arg2; \ - int arg3; \ - const char *arg4; \ - \ - if (!PyArg_ParseTuple(args, "OOis", &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)) ;\ +#define _wrap_objobjintstr2obj(func, intype1, intype2, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *arg4_; \ + intype1 arg1; \ + intype2 arg2; \ + int arg3; \ + const char *arg4; \ + \ + if (!PyArg_ParseTuple(args, "OOiU", &obj1, &obj2, &arg3, &arg4_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg4 = PyUnicode_AS_DATA(arg4_); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)) ; \ } /** * Wrap LLVM functions of the type * outtype func(intype1 arg1, intype2 arg2, intype3 arg3, const char *arg4) */ -#define _wrap_objobjobjstr2obj(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; \ - \ - if (!PyArg_ParseTuple(args, "OOOs", &obj1, &obj2, &obj3, &arg4)) \ - 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)); \ +#define _wrap_objobjobjstr2obj(func, intype1, intype2, intype3, outtype)\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3, *arg4_; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + const char *arg4; \ + \ + if (!PyArg_ParseTuple(args, "OOOU", &obj1, &obj2, &obj3, &arg4_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + arg4 = PyUnicode_AS_DATA(arg4_); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \ } /** @@ -650,23 +662,23 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, intype3 arg3, arg4) */ #define _wrap_objobjobjint2obj(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; \ - \ - if (!PyArg_ParseTuple(args, "OOOi", &obj1, &obj2, &obj3, &arg4)) \ - 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)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + int arg4; \ + \ + if (!PyArg_ParseTuple(args, "OOOi", &obj1, &obj2, &obj3, &arg4)) \ + 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)); \ } /** @@ -674,50 +686,51 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 arg2, intype3 arg3, intype arg4) */ #define _wrap_objobjobjobj2obj(func, intype1, intype2, intype3, intype4, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3, *obj4; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 arg3; \ - intype4 arg4; \ - \ - if (!PyArg_ParseTuple(args, "OOOO", &obj1, &obj2, &obj3, &obj4)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3, *obj4; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + intype4 arg4; \ + \ + if (!PyArg_ParseTuple(args, "OOOO", &obj1, &obj2, &obj3, &obj4)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4)); \ } /** * Wrap LLVM functions of the type * outtype func(intype1 arg1, intype2 arg2, intype3 arg3, intype arg4, const char *arg5) */ -#define _wrap_objobjobjobjstr2obj(func, intype1, intype2, intype3, intype4, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3, *obj4; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 arg3; \ - intype4 arg4; \ - const char *arg5; \ - \ - if (!PyArg_ParseTuple(args, "OOOOs", &obj1, &obj2, &obj3, &obj4, &arg5)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \ +#define _wrap_objobjobjobjstr2obj(func, intype1, intype2, intype3, intype4, outtype)\ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3, *obj4, *arg5_; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + intype4 arg4; \ + const char *arg5; \ + \ + if (!PyArg_ParseTuple(args, "OOOOU", &obj1, &obj2, &obj3, &obj4, &arg5_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ + arg5 = PyUnicode_AS_DATA(arg5_); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \ } /** @@ -725,24 +738,25 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, enum_intype2 arg2, intype3 arg3, intype4 arg4, const char *arg5) */ #define _wrap_objenumobjobjstr2obj(func, intype1, intype2, intype3, intype4, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj3, *obj4; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 arg3; \ - intype4 arg4; \ - const char *arg5; \ - \ - if (!PyArg_ParseTuple(args, "OiOOs", &obj1, &arg2, &obj3, &obj4, &arg5)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ - arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ - \ - return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj3, *obj4, *arg5_; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 arg3; \ + intype4 arg4; \ + const char *arg5; \ + \ + if (!PyArg_ParseTuple(args, "OiOOU", &obj1, &arg2, &obj3, &obj4, &arg5_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg3 = ( intype3 ) PyCapsule_GetPointer(obj3, NULL); \ + arg4 = ( intype4 ) PyCapsule_GetPointer(obj4, NULL); \ + arg5 = PyUnicode_AS_DATA(arg5_); \ + \ + return ctor_ ## outtype ( func (arg1, arg2, arg3, arg4, arg5)); \ } /** @@ -750,27 +764,27 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 *arg2v, unsigned arg2n) * where arg2v is an array of intype2 elements, arg2n in length. */ -#define _wrap_objlist2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 *arg2v; \ - unsigned arg2n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2n = (unsigned) PyList_Size(obj2); \ - if (!(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1, arg2v, arg2n); \ - free(arg2v); \ - return ctor_ ## outtype (ret); \ +#define _wrap_objlist2obj(func, intype1, intype2, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2; \ + intype1 arg1; \ + intype2 *arg2v; \ + unsigned arg2n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "OO", &obj1, &obj2)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2n = (unsigned) PyList_Size(obj2); \ + if (!(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n)))\ + return PyErr_NoMemory(); \ + \ + ret = func (arg1, arg2v, arg2n); \ + free(arg2v); \ + return ctor_ ## outtype (ret); \ } /** @@ -778,26 +792,26 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 *arg1v, unsigned arg1n, int arg2) * where arg1v is an array of intype1 elements, arg1n in length. */ -#define _wrap_listint2obj(func, intype1, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1; \ - int arg2; \ - intype1 *arg1v; \ - unsigned arg1n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "Oi", &obj1, &arg2)) \ - return NULL; \ - \ - arg1n = (unsigned) PyList_Size(obj1); \ - if (!(arg1v = ( intype1 *)make_array_from_list(obj1, arg1n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1v, arg1n, arg2); \ - free(arg1v); \ - return ctor_ ## outtype (ret); \ +#define _wrap_listint2obj(func, intype1, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1; \ + int arg2; \ + intype1 *arg1v; \ + unsigned arg1n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "Oi", &obj1, &arg2)) \ + return NULL; \ + \ + arg1n = (unsigned) PyList_Size(obj1); \ + if (!(arg1v = ( intype1 *)make_array_from_list(obj1, arg1n)))\ + return PyErr_NoMemory(); \ + \ + ret = func (arg1v, arg1n, arg2); \ + free(arg1v); \ + return ctor_ ## outtype (ret); \ } /** @@ -805,25 +819,25 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 *arg1v, unsigned arg1n) * where arg1v is an array of intype1 elements, arg1n in length. */ -#define _wrap_list2obj(func, intype1, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1; \ - intype1 *arg1v; \ - unsigned arg1n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "O", &obj1)) \ - return NULL; \ - \ - arg1n = (unsigned) PyList_Size(obj1); \ - if (!(arg1v = ( intype1 *)make_array_from_list(obj1, arg1n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1v, arg1n); \ - free(arg1v); \ - return ctor_ ## outtype (ret); \ +#define _wrap_list2obj(func, intype1, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1; \ + intype1 *arg1v; \ + unsigned arg1n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "O", &obj1)) \ + return NULL; \ + \ + arg1n = (unsigned) PyList_Size(obj1); \ + if (!(arg1v = ( intype1 *)make_array_from_list(obj1, arg1n)))\ + return PyErr_NoMemory(); \ + \ + ret = func (arg1v, arg1n); \ + free(arg1v); \ + return ctor_ ## outtype (ret); \ } /** @@ -831,28 +845,28 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, intype2 *arg2v, unsigned arg2n, int arg3) * where arg2v is an array of intype2 elements, arg2n in length. */ -#define _wrap_objlistint2obj(func, intype1, intype2, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2; \ - intype1 arg1; \ - intype2 *arg2v; \ - unsigned arg2n; \ - int arg3; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "OOi", &obj1, &obj2, &arg3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2n = (unsigned) PyList_Size(obj2); \ - if (!(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1, arg2v, arg2n, arg3); \ - free(arg2v); \ - return ctor_ ## outtype (ret); \ +#define _wrap_objlistint2obj(func, intype1, intype2, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2; \ + intype1 arg1; \ + intype2 *arg2v; \ + unsigned arg2n; \ + int arg3; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "OOi", &obj1, &obj2, &arg3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2n = (unsigned) PyList_Size(obj2); \ + if (!(arg2v = ( intype2 *)make_array_from_list(obj2, arg2n)))\ + return PyErr_NoMemory(); \ + \ + ret = func (arg1, arg2v, arg2n, arg3); \ + free(arg2v); \ + return ctor_ ## outtype (ret); \ } /** @@ -860,28 +874,28 @@ _w ## func (PyObject *self, PyObject *args) \ * outtype func(intype1 arg1, int arg2, intype3 *arg3v, unsigned arg3n) * where arg3v is an array of intype3 elements, arg3n in length. */ -#define _wrap_objintlist2obj(func, intype1, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj3; \ - intype1 arg1; \ - int arg2; \ - intype3 *arg3v; \ - unsigned arg3n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "OiO", &obj1, &arg2, &obj3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg3n = (unsigned) PyList_Size(obj3); \ - if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1, arg2, arg3v, arg3n); \ - free(arg3v); \ - return ctor_ ## outtype (ret); \ +#define _wrap_objintlist2obj(func, intype1, intype3, outtype) \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj3; \ + intype1 arg1; \ + int arg2; \ + intype3 *arg3v; \ + unsigned arg3n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "OiO", &obj1, &arg2, &obj3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg3n = (unsigned) PyList_Size(obj3); \ + if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n)))\ + return PyErr_NoMemory(); \ + \ + ret = func (arg1, arg2, arg3v, arg3n); \ + free(arg3v); \ + return ctor_ ## outtype (ret); \ } /** @@ -890,28 +904,28 @@ _w ## func (PyObject *self, PyObject *args) \ * where arg3v is an array of intype3 elements, arg3n in length. */ #define _wrap_objobjlist2obj(func, intype1, intype2, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 *arg3v; \ - unsigned arg3n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3n = (unsigned) PyList_Size(obj3); \ - if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1, arg2, arg3v, arg3n); \ - free(arg3v); \ - return ctor_ ## outtype (ret); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 *arg3v; \ + unsigned arg3n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "OOO", &obj1, &obj2, &obj3)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3n = (unsigned) PyList_Size(obj3); \ + if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n))) \ + return PyErr_NoMemory(); \ + \ + ret = func (arg1, arg2, arg3v, arg3n); \ + free(arg3v); \ + return ctor_ ## outtype (ret); \ } /** @@ -920,29 +934,30 @@ _w ## func (PyObject *self, PyObject *args) \ * where arg3v is an array of intype3 elements, arg3n in length. */ #define _wrap_objobjliststr2obj(func, intype1, intype2, intype3, outtype) \ -static PyObject * \ -_w ## func (PyObject *self, PyObject *args) \ -{ \ - PyObject *obj1, *obj2, *obj3; \ - const char *arg4; \ - intype1 arg1; \ - intype2 arg2; \ - intype3 *arg3v; \ - unsigned arg3n; \ - outtype ret; \ - \ - if (!PyArg_ParseTuple(args, "OOOs", &obj1, &obj2, &obj3, &arg4))\ - return NULL; \ - \ - arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ - arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ - arg3n = ( unsigned ) PyList_Size(obj3); \ - if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n))) \ - return PyErr_NoMemory(); \ - \ - ret = func (arg1, arg2, arg3v, arg3n, arg4); \ - free(arg3v); \ - return ctor_ ## outtype (ret); \ +static PyObject * \ +_w ## func (PyObject *self, PyObject *args) \ +{ \ + PyObject *obj1, *obj2, *obj3, *arg4_; \ + const char *arg4; \ + intype1 arg1; \ + intype2 arg2; \ + intype3 *arg3v; \ + unsigned arg3n; \ + outtype ret; \ + \ + if (!PyArg_ParseTuple(args, "OOOU", &obj1, &obj2, &obj3, &arg4_)) \ + return NULL; \ + \ + arg1 = ( intype1 ) PyCapsule_GetPointer(obj1, NULL); \ + arg2 = ( intype2 ) PyCapsule_GetPointer(obj2, NULL); \ + arg3n = ( unsigned ) PyList_Size(obj3); \ + arg4 = PyUnicode_AS_DATA(arg4_); \ + if (!(arg3v = ( intype3 *)make_array_from_list(obj3, arg3n))) \ + return PyErr_NoMemory(); \ + \ + ret = func (arg1, arg2, arg3v, arg3n, arg4); \ + free(arg3v); \ + return ctor_ ## outtype (ret); \ } /** @@ -963,7 +978,7 @@ _w ## func (PyObject *self, PyObject *args) \ return NULL; \ \ val = func (arg1); \ - ret = PyBytes_FromString(val); \ + ret = PyBytes_FromString(val); \ LLVMDisposeMessage(val); \ return ret; \ }