[llvm-commits] [llvm] r44814 - /llvm/trunk/include/llvm/Instruction.h
Chris Lattner
sabre at nondot.org
Mon Dec 10 14:18:53 PST 2007
Author: lattner
Date: Mon Dec 10 16:18:53 2007
New Revision: 44814
URL: http://llvm.org/viewvc/llvm-project?rev=44814&view=rev
Log:
split isBinaryOp into a static and member version.
Modified:
llvm/trunk/include/llvm/Instruction.h
Modified: llvm/trunk/include/llvm/Instruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=44814&r1=44813&r2=44814&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instruction.h (original)
+++ llvm/trunk/include/llvm/Instruction.h Mon Dec 10 16:18:53 2007
@@ -102,21 +102,22 @@
/// 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 @@
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 @@
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
More information about the llvm-commits
mailing list