mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-02 08:26:29 +00:00
Implement classof for SetCondInst so that instcombine doesn't break on dyn_cast<SetCondInst>
llvm-svn: 3493
This commit is contained in:
parent
e2a8fb2f79
commit
cb3870e441
@ -34,6 +34,17 @@ public:
|
||||
// For example seteq -> setne, setgt -> setle, setlt -> setge, etc...
|
||||
//
|
||||
BinaryOps getInverseCondition() const;
|
||||
|
||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||
static inline bool classof(const SetCondInst *) { return true; }
|
||||
static inline bool classof(const Instruction *I) {
|
||||
return I->getOpcode() == SetEQ || I->getOpcode() == SetNE ||
|
||||
I->getOpcode() == SetLE || I->getOpcode() == SetGE ||
|
||||
I->getOpcode() == SetLT || I->getOpcode() == SetGT;
|
||||
}
|
||||
static inline bool classof(const Value *V) {
|
||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user