Add new BinaryOperator::createAdd/Sub/... methods to avoid having to type

llvm::Instruction:: all of the time.

llvm-svn: 14105
This commit is contained in:
Chris Lattner 2004-06-10 01:43:29 +00:00
parent 68a038e6a1
commit 867653ad6a
1 changed files with 16 additions and 0 deletions

View File

@ -107,6 +107,22 @@ public:
const std::string &Name,
BasicBlock *InsertAtEnd);
/// create* - These methods just forward to create, and are useful when you
/// statically know what type of instruction you're going to create. These
/// helpers just save some typing.
#define HANDLE_BINARY_INST(N, OPC, CLASS) \
static BinaryOperator *create##OPC(Value *V1, Value *V2, \
const std::string &Name = "") {\
return create(Instruction::OPC, V1, V2, Name);\
}
#include "llvm/Instruction.def"
#define HANDLE_BINARY_INST(N, OPC, CLASS) \
static BinaryOperator *create##OPC(Value *V1, Value *V2, \
const std::string &Name, BasicBlock *BB) {\
return create(Instruction::OPC, V1, V2, Name, BB);\
}
#include "llvm/Instruction.def"
/// Helper functions to construct and inspect unary operations (NEG and NOT)
/// via binary operators SUB and XOR: