aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-11 13:04:48 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-11 13:04:48 +0000
commit97c0e2107be9490333866c223250ece92c47630f (patch)
treea3921b96e7ffc0262832bbeaa70294007a0b7aeb /lib/VMCore/Instructions.cpp
parent4d26a0619dc73f5395e216b7c0e7bf855b954d1c (diff)
downloadexternal_llvm-97c0e2107be9490333866c223250ece92c47630f.zip
external_llvm-97c0e2107be9490333866c223250ece92c47630f.tar.gz
external_llvm-97c0e2107be9490333866c223250ece92c47630f.tar.bz2
Fix a bug where ICmpInst objects instantiated directly with a name would
not retain that name. Not noticed because AsmParser always sets name after construction. However, llvm2cpp noticed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index f9aa3e7..f6abd85 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -2070,6 +2070,7 @@ CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
Ops[0].init(LHS, this);
Ops[1].init(RHS, this);
SubclassData = predicate;
+ setName(Name);
if (op == Instruction::ICmp) {
assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
@@ -2093,7 +2094,6 @@ CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
// Check that the operands are the right type
assert(Op0Ty->isFloatingPoint() &&
"Invalid operand types for FCmp instruction");
- setName(Name);
}
CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
@@ -2102,6 +2102,7 @@ CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
Ops[0].init(LHS, this);
Ops[1].init(RHS, this);
SubclassData = predicate;
+ setName(Name);
if (op == Instruction::ICmp) {
assert(predicate >= ICmpInst::FIRST_ICMP_PREDICATE &&
predicate <= ICmpInst::LAST_ICMP_PREDICATE &&
@@ -2126,7 +2127,6 @@ CmpInst::CmpInst(OtherOps op, unsigned short predicate, Value *LHS, Value *RHS,
// Check that the operands are the right type
assert(Op0Ty->isFloatingPoint() &&
"Invalid operand types for FCmp instruction");
- setName(Name);
}
CmpInst *