aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/iOther.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/iOther.h')
-rw-r--r--include/llvm/iOther.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/include/llvm/iOther.h b/include/llvm/iOther.h
index 1e4733d..d0e0e2e 100644
--- a/include/llvm/iOther.h
+++ b/include/llvm/iOther.h
@@ -55,6 +55,16 @@ public:
// removeIncomingValue - Remove an incoming value. This is useful if a
// predecessor basic block is deleted. The value removed is returned.
Value *removeIncomingValue(const BasicBlock *BB);
+
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const PHINode *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return I->getOpcode() == Instruction::PHINode;
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
};
@@ -79,6 +89,15 @@ public:
virtual Instruction *clone() const { return new CastInst(*this); }
virtual const char *getOpcodeName() const { return "cast"; }
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const CastInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return I->getOpcode() == Cast;
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
};
@@ -105,8 +124,8 @@ public:
inline Method *getParent() { return Parent; }
// Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool isa(const MethodArgument *) { return true; }
- static inline bool isa(const Value *V) {
+ static inline bool classof(const MethodArgument *) { return true; }
+ static inline bool classof(const Value *V) {
return V->getValueType() == MethodArgumentVal;
}
};
@@ -133,6 +152,15 @@ public:
Method *getCalledMethod() {
return cast<Method>(Operands[0]);
}
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const CallInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return I->getOpcode() == Instruction::Call;
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
};
@@ -161,6 +189,16 @@ public:
virtual const char *getOpcodeName() const {
return getOpcode() == Shl ? "shl" : "shr";
}
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const ShiftInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return (I->getOpcode() == Instruction::Shr) |
+ (I->getOpcode() == Instruction::Shl);
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
};
#endif