Python3 ready. Py2.7 and Py3 working. Drop PyCObject for all.

Pre Py2.7 support should be possible by including  "capsulethunk.h". (See llvm/wrap.h)
This commit is contained in:
Siu Kwan Lam 2012-07-26 15:25:23 -07:00
commit 9aadd489c3
14 changed files with 163 additions and 1142 deletions

View file

@ -148,17 +148,15 @@ void LLVMEngineBuilderSetOptLevel(LLVMEngineBuilderRef eb, int level)
}
LLVMExecutionEngineRef LLVMEngineBuilderCreate(LLVMEngineBuilderRef eb, char **err)
LLVMExecutionEngineRef LLVMEngineBuilderCreate(LLVMEngineBuilderRef eb, std::string & error)
{
using namespace llvm;
std::string errstring;
LLVMExecutionEngineRef ret;
ret = wrap(unwrap(eb)->setErrorStr(&errstring).create());
ret = wrap(unwrap(eb)->setErrorStr(&error).create());
if ( !errstring.empty() ) {
*err = strdup(errstring.c_str());
return 0;
if ( !error.empty() ) { // error string is set
return NULL;
} else {
return ret;
}
@ -534,8 +532,7 @@ LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef module, int id,
return wrap(intfunc);
}
LLVMModuleRef LLVMGetModuleFromAssembly(const char *asmtext, unsigned txtlen,
char **out)
LLVMModuleRef LLVMGetModuleFromAssembly(const char *asmtext, char **out)
{
assert(asmtext);
assert(out);