#include "llvm/iOperators.h"
#include "llvm/Type.h"
+#include "llvm/Constants.h"
using std::cerr;
//===----------------------------------------------------------------------===//
}
}
+BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name) {
+ return new GenericBinaryInst(Instruction::Sub,
+ Constant::getNullValue(Op->getType()), Op, Name);
+}
+
+BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name) {
+ return new GenericBinaryInst(Instruction::Xor, Op,
+ ConstantIntegral::getAllOnesValue(Op->getType()),
+ Name);
+}
+
+
// swapOperands - Exchange the two operands to this instruction. This
// instruction is safe to use on any binary instruction and does not
// modify the semantics of the instruction. If the instruction is