aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-24 20:48:18 +0000
committerChris Lattner <sabre@nondot.org>2007-08-24 20:48:18 +0000
commit3c7088f8b4b76c5e605dd093ba805e11d039ab52 (patch)
tree8fb8ce727177526162e5d9dc972c949d7fee24f5 /lib
parent4e585c7e3ab96d56a3b913ef34f1db4907826e30 (diff)
downloadexternal_llvm-3c7088f8b4b76c5e605dd093ba805e11d039ab52.tar.gz
external_llvm-3c7088f8b4b76c5e605dd093ba805e11d039ab52.tar.bz2
external_llvm-3c7088f8b4b76c5e605dd093ba805e11d039ab52.zip
sink clone() down the class hierarchy from CmpInst into ICmpInst/FCmpInst.
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
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 5297374e25..43f89760af 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -2595,8 +2595,11 @@ BinaryOperator *BinaryOperator::clone() const {
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); }