diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-10 22:18:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-10 22:18:53 +0000 |
commit | 555c729a2f604027840b96d8e05f7d07d1f51053 (patch) | |
tree | 813ed03db020cc0bde4e408e723cd94d1974f63e /include/llvm/Instruction.h | |
parent | 9795bb867734054f83a2cfe9fc81ae0032707485 (diff) | |
download | external_llvm-555c729a2f604027840b96d8e05f7d07d1f51053.zip external_llvm-555c729a2f604027840b96d8e05f7d07d1f51053.tar.gz external_llvm-555c729a2f604027840b96d8e05f7d07d1f51053.tar.bz2 |
split isBinaryOp into a static and member version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instruction.h')
-rw-r--r-- | include/llvm/Instruction.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 8da89e2..983e245 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -102,21 +102,22 @@ public: /// one of the enums that is coming soon (down below)... /// unsigned getOpcode() const { return getValueID() - InstructionVal; } - const char *getOpcodeName() const { - return getOpcodeName(getOpcode()); - } + const char *getOpcodeName() const { return getOpcodeName(getOpcode()); } + bool isTerminator() const { return isTerminator(getOpcode()); } + bool isBinaryOp() const { return isBinaryOp(getOpcode()); } + bool isShift() { return isShift(getOpcode()); } + bool isCast() const { return isCast(getOpcode()); } + + + static const char* getOpcodeName(unsigned OpCode); static inline bool isTerminator(unsigned OpCode) { return OpCode >= TermOpsBegin && OpCode < TermOpsEnd; } - inline bool isTerminator() const { // Instance of TerminatorInst? - return isTerminator(getOpcode()); - } - - inline bool isBinaryOp() const { - return getOpcode() >= BinaryOpsBegin && getOpcode() < BinaryOpsEnd; + static inline bool isBinaryOp(unsigned Opcode) { + return Opcode >= BinaryOpsBegin && Opcode < BinaryOpsEnd; } /// @brief Determine if the Opcode is one of the shift instructions. @@ -124,10 +125,6 @@ public: return Opcode >= Shl && Opcode <= AShr; } - /// @brief Determine if the instruction's opcode is one of the shift - /// instructions. - inline bool isShift() { return isShift(getOpcode()); } - /// isLogicalShift - Return true if this is a logical shift left or a logical /// shift right. inline bool isLogicalShift() { @@ -145,11 +142,6 @@ public: 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 |