diff options
Diffstat (limited to 'include/llvm/Instruction.h')
-rw-r--r-- | include/llvm/Instruction.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 591e0d2b88..4af83c7a56 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -125,6 +125,16 @@ public: return getOpcode() >= BinaryOpsBegin && getOpcode() < BinaryOpsEnd; } + /// @brief Determine if the OpCode is one of the CastInst instructions. + static inline bool isCast(unsigned OpCode) { + return OpCode >= CastOpsBegin && OpCode < CastOpsEnd; + } + + /// @brief Determine if this is one of the CastInst instructions. + inline bool isCast() const { + return isCast(getOpcode()); + } + /// isAssociative - Return true if the instruction is associative: /// /// Associative operators satisfy: x op (y op z) === (x op y) op z @@ -191,6 +201,13 @@ public: #include "llvm/Instruction.def" }; + enum CastOps { +#define FIRST_CAST_INST(N) CastOpsBegin = N, +#define HANDLE_CAST_INST(N, OPC, CLASS) OPC = N, +#define LAST_CAST_INST(N) CastOpsEnd = N+1 +#include "llvm/Instruction.def" + }; + enum OtherOps { #define FIRST_OTHER_INST(N) OtherOpsBegin = N, #define HANDLE_OTHER_INST(N, OPC, CLASS) OPC = N, |