This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst
both have an out-of-line virtual method to home the class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41371
91177308-0d34-0410-b5e6-
96231b3b80d8
Value *S2, const std::string &Name,
BasicBlock *InsertAtEnd);
- /// @brief Implement superclass method.
- virtual CmpInst *clone() const;
-
/// @brief Get the opcode casted to the right type
OtherOps getOpcode() const {
return static_cast<OtherOps>(Instruction::getOpcode());
std::swap(Ops[0], Ops[1]);
}
+ virtual ICmpInst *clone() const;
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ICmpInst *) { return true; }
static inline bool classof(const Instruction *I) {
std::swap(Ops[0], Ops[1]);
}
+ virtual FCmpInst *clone() const;
+
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const FCmpInst *) { return true; }
static inline bool classof(const Instruction *I) {
return create(getOpcode(), Ops[0], Ops[1]);
}
-CmpInst* CmpInst::clone() const {
- return create(getOpcode(), getPredicate(), Ops[0], Ops[1]);
+FCmpInst* FCmpInst::clone() const {
+ return new FCmpInst(getPredicate(), Ops[0], Ops[1]);
+}
+ICmpInst* ICmpInst::clone() const {
+ return new ICmpInst(getPredicate(), Ops[0], Ops[1]);
}
MallocInst *MallocInst::clone() const { return new MallocInst(*this); }