diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-06-10 01:43:29 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-06-10 01:43:29 +0000 |
| commit | 867653ad6a7183b52c08370bbcb6e9d2119d12eb (patch) | |
| tree | 0842e03290abb643c547547ddb13584742e9be1f /llvm/include | |
| parent | 68a038e6a1d00f255bc8e13b1289694b9d3ccd48 (diff) | |
| download | bcm5719-llvm-867653ad6a7183b52c08370bbcb6e9d2119d12eb.tar.gz bcm5719-llvm-867653ad6a7183b52c08370bbcb6e9d2119d12eb.zip | |
Add new BinaryOperator::createAdd/Sub/... methods to avoid having to type
llvm::Instruction:: all of the time.
llvm-svn: 14105
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/InstrTypes.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/include/llvm/InstrTypes.h b/llvm/include/llvm/InstrTypes.h index c615888d818..723b3547170 100644 --- a/llvm/include/llvm/InstrTypes.h +++ b/llvm/include/llvm/InstrTypes.h @@ -106,6 +106,22 @@ public: static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2, 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) |

