aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/InstrTypes.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-10 01:43:29 +0000
committerChris Lattner <sabre@nondot.org>2004-06-10 01:43:29 +0000
commit5118872dd2a62b3ba022aff37ebc26003cca5adb (patch)
tree08fcce26774be67651ee3fd3d790a5a8e8f278ec /include/llvm/InstrTypes.h
parente9e326e2eb223ea4bc6762a099ce3c314e4daedb (diff)
downloadexternal_llvm-5118872dd2a62b3ba022aff37ebc26003cca5adb.zip
external_llvm-5118872dd2a62b3ba022aff37ebc26003cca5adb.tar.gz
external_llvm-5118872dd2a62b3ba022aff37ebc26003cca5adb.tar.bz2
Add new BinaryOperator::createAdd/Sub/... methods to avoid having to type
llvm::Instruction:: all of the time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/InstrTypes.h')
-rw-r--r--include/llvm/InstrTypes.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h
index c615888..723b354 100644
--- a/include/llvm/InstrTypes.h
+++ b/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)