Add CodeModel

This commit is contained in:
Siu Kwan Lam 2013-01-03 15:37:11 -06:00
commit f01da12e16
4 changed files with 47 additions and 21 deletions

View file

@ -1082,17 +1082,18 @@ static PyObject *
_wLLVMTargetMachineLookup(PyObject * self, PyObject * args)
{
LLVMPY_TRY
const char *arch;
const char *triple;
const char *cpu;
const char *features;
int opt;
int opt, codemodel;
if (!PyArg_ParseTuple(args, "sssi", &arch, &cpu, &features, &opt))
if (!PyArg_ParseTuple(args, "sssii", &triple, &cpu, &features,
&opt, &codemodel))
return NULL;
std::string error;
LLVMTargetMachineRef tm = LLVMTargetMachineLookup(arch, cpu, features, opt,
error);
LLVMTargetMachineRef tm = LLVMTargetMachineLookup(triple, cpu, features,
opt, codemodel, error);
if(!error.empty()){
PyErr_SetString(PyExc_RuntimeError, error.c_str());
return NULL;
@ -1109,14 +1110,15 @@ _wLLVMCreateTargetMachine(PyObject * self, PyObject * args)
const char *triple;
const char *cpu;
const char *features;
int opt;
int opt, codemodel;
if (!PyArg_ParseTuple(args, "sssi", &triple, &cpu, &features, &opt))
if (!PyArg_ParseTuple(args, "sssii", &triple, &cpu, &features,
&opt, &codemodel))
return NULL;
std::string error;
LLVMTargetMachineRef tm = LLVMCreateTargetMachine(triple, cpu, features, opt,
error);
LLVMTargetMachineRef tm = LLVMCreateTargetMachine(triple, cpu, features,
opt, codemodel, error);
if(!error.empty()){
PyErr_SetString(PyExc_RuntimeError, error.c_str());
return NULL;