Fix: "not" is not available on some compiler.
This commit is contained in:
parent
4bf0fa65ef
commit
1a34e412a5
2 changed files with 9 additions and 9 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
static
|
static
|
||||||
void do_assert(int cond, const char * msg, const char *file, unsigned line){
|
void do_assert(int cond, const char * msg, const char *file, unsigned line){
|
||||||
if (not cond) {
|
if (!cond) {
|
||||||
fprintf(stderr, "Assertion failed %s:%d\n%s\n", file, line, msg);
|
fprintf(stderr, "Assertion failed %s:%d\n%s\n", file, line, msg);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -586,7 +586,7 @@ PyObject* Linker_LinkInModule(llvm::Linker* Linker,
|
||||||
{
|
{
|
||||||
std::string errmsg;
|
std::string errmsg;
|
||||||
bool failed = Linker->LinkInModule(Mod, &errmsg);
|
bool failed = Linker->LinkInModule(Mod, &errmsg);
|
||||||
if (not failed) {
|
if (! failed) {
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
} else {
|
} else {
|
||||||
if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) {
|
if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) {
|
||||||
|
|
@ -604,7 +604,7 @@ PyObject* Linker_LinkModules(llvm::Module* Dest,
|
||||||
{
|
{
|
||||||
std::string errmsg;
|
std::string errmsg;
|
||||||
bool failed = llvm::Linker::LinkModules(Dest, Src, Mode, &errmsg);
|
bool failed = llvm::Linker::LinkModules(Dest, Src, Mode, &errmsg);
|
||||||
if (not failed) {
|
if (! failed) {
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
} else {
|
} else {
|
||||||
if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) {
|
if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) {
|
||||||
|
|
@ -686,7 +686,7 @@ PyObject* ConstantArray_get(llvm::ArrayType* Ty, PyObject* Consts)
|
||||||
std::vector<Constant*> vec_consts;
|
std::vector<Constant*> vec_consts;
|
||||||
bool ok = extract<Constant>::from_py_sequence(vec_consts, Consts,
|
bool ok = extract<Constant>::from_py_sequence(vec_consts, Consts,
|
||||||
"llvm::Value");
|
"llvm::Value");
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
Constant* ary = ConstantArray::get(Ty, vec_consts);
|
Constant* ary = ConstantArray::get(Ty, vec_consts);
|
||||||
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
||||||
}
|
}
|
||||||
|
|
@ -699,7 +699,7 @@ PyObject* ConstantStruct_get(llvm::StructType* Ty, PyObject* Elems)
|
||||||
std::vector<Constant*> vec_consts;
|
std::vector<Constant*> vec_consts;
|
||||||
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
||||||
"llvm::Value");
|
"llvm::Value");
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
Constant* ary = ConstantStruct::get(Ty, vec_consts);
|
Constant* ary = ConstantStruct::get(Ty, vec_consts);
|
||||||
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
||||||
}
|
}
|
||||||
|
|
@ -713,7 +713,7 @@ PyObject* ConstantStruct_getAnon(PyObject* Elems,
|
||||||
std::vector<Constant*> vec_consts;
|
std::vector<Constant*> vec_consts;
|
||||||
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
||||||
"llvm::Value");
|
"llvm::Value");
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
Constant* ary = ConstantStruct::getAnon(vec_consts, isPacked);
|
Constant* ary = ConstantStruct::getAnon(vec_consts, isPacked);
|
||||||
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
||||||
}
|
}
|
||||||
|
|
@ -726,7 +726,7 @@ PyObject* ConstantVector_get(PyObject* Elems)
|
||||||
std::vector<Constant*> vec_consts;
|
std::vector<Constant*> vec_consts;
|
||||||
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
bool ok = extract<Constant>::from_py_sequence(vec_consts, Elems,
|
||||||
"llvm::Value");
|
"llvm::Value");
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
Constant* ary = ConstantVector::get(vec_consts);
|
Constant* ary = ConstantVector::get(vec_consts);
|
||||||
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
return pycapsule_new(ary, "llvm::Value", "llvm::Constant");
|
||||||
}
|
}
|
||||||
|
|
@ -756,7 +756,7 @@ PyObject* MDNode_get(llvm::LLVMContext &Cxt, PyObject* Vals)
|
||||||
bool accept_null = true;
|
bool accept_null = true;
|
||||||
bool ok = extract<llvm::Value>::from_py_sequence(vals, Vals, "llvm::Value",
|
bool ok = extract<llvm::Value>::from_py_sequence(vals, Vals, "llvm::Value",
|
||||||
accept_null);
|
accept_null);
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
llvm::MDNode* md = llvm::MDNode::get(Cxt, vals);
|
llvm::MDNode* md = llvm::MDNode::get(Cxt, vals);
|
||||||
return pycapsule_new(md, "llvm::Value", "llvm::MDNode");
|
return pycapsule_new(md, "llvm::Value", "llvm::MDNode");
|
||||||
}
|
}
|
||||||
|
|
@ -778,7 +778,7 @@ PyObject* IRBuilder_CreateAggregateRet(llvm::IRBuilder<>* builder,
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
std::vector<Value*> vec_values;
|
std::vector<Value*> vec_values;
|
||||||
bool ok = extract<Value>::from_py_sequence(vec_values, Vals, "llvm::Value");
|
bool ok = extract<Value>::from_py_sequence(vec_values, Vals, "llvm::Value");
|
||||||
if (not ok) return NULL;
|
if (! ok) return NULL;
|
||||||
Value** ptr_values = &vec_values[0];
|
Value** ptr_values = &vec_values[0];
|
||||||
ReturnInst* inst = builder->CreateAggregateRet(ptr_values, N);
|
ReturnInst* inst = builder->CreateAggregateRet(ptr_values, N);
|
||||||
return pycapsule_new(inst, "llvm::Value", "llvm::ReturnInst");
|
return pycapsule_new(inst, "llvm::Value", "llvm::ReturnInst");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue