More properties/methods for TargetData.

git-svn-id: http://llvm-py.googlecode.com/svn/trunk@73 8d1e9007-1d4e-0410-b67e-1979fd6579aa
This commit is contained in:
mdevan.foobar 2009-03-01 08:34:04 +00:00
commit b2d8ff38a8
7 changed files with 178 additions and 8 deletions

View file

@ -47,6 +47,13 @@
#include "llvm-c/Target.h"
/*===----------------------------------------------------------------------===*/
/* Typedefs */
/*===----------------------------------------------------------------------===*/
typedef unsigned long long llvmwrap_ull;
/*===----------------------------------------------------------------------===*/
/* Type ctor/dtor */
/*===----------------------------------------------------------------------===*/
@ -75,7 +82,8 @@ _declare_std_ctor(LLVMTargetDataRef)
_declare_std_ctor(LLVMGenericValueRef)
/* standard types */
PyObject *ctor_int(int i);
_declare_std_ctor(int)
_declare_std_ctor(llvmwrap_ull)
/*===----------------------------------------------------------------------===*/
@ -471,6 +479,50 @@ _w ## func (PyObject *self, PyObject *args) \
return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\
}
/**
* Wrap LLVM functions of the type
* 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 ) PyCObject_AsVoidPtr(obj1); \
arg2 = ( intype2 ) PyCObject_AsVoidPtr(obj2); \
\
return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\
}
/**
* Wrap LLVM functions of the type
* 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 ) PyCObject_AsVoidPtr(obj1); \
arg2 = ( intype2 ) PyCObject_AsVoidPtr(obj2); \
\
return ctor_ ## outtype ( func (arg1, arg2, arg3)) ;\
}
/**
* Wrap LLVM functions of the type
* void func(intype1 arg1, <unsigned/signed int> arg2, <unsigned/signed int> arg3)