diff options
Diffstat (limited to 'include/llvm/IR/Instruction.h')
-rw-r--r-- | include/llvm/IR/Instruction.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/IR/Instruction.h b/include/llvm/IR/Instruction.h index 00c431834e314..d8db29e158867 100644 --- a/include/llvm/IR/Instruction.h +++ b/include/llvm/IR/Instruction.h @@ -152,9 +152,14 @@ public: return getOpcode() == AShr; } + /// Determine if the Opcode is and/or/xor. + static inline bool isBitwiseLogicOp(unsigned Opcode) { + return Opcode == And || Opcode == Or || Opcode == Xor; + } + /// Return true if this is and/or/xor. inline bool isBitwiseLogicOp() const { - return getOpcode() == And || getOpcode() == Or || getOpcode() == Xor; + return isBitwiseLogicOp(getOpcode()); } /// Determine if the OpCode is one of the CastInst instructions. |