aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-17 19:14:47 +0000
committerChris Lattner <sabre@nondot.org>2006-09-17 19:14:47 +0000
commita5b07404f79036727ba47624050040defe59a5fa (patch)
treec42b65ef45402ae11d24b5724d239fe2d1d39d22 /lib
parente81f725b3ab681ba4beaac0ba03c1a1296454680 (diff)
Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/ConstantFold.cpp2
-rw-r--r--lib/VMCore/Constants.cpp4
-rw-r--r--lib/VMCore/Instruction.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 2263d5ed83..32945c290f 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -1212,7 +1212,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
// If we successfully folded the expression, return it now.
if (C) return C;
- if (SetCondInst::isRelational(Opcode)) {
+ if (SetCondInst::isComparison(Opcode)) {
if (isa<UndefValue>(V1) || isa<UndefValue>(V2))
return UndefValue::get(Type::BoolTy);
switch (evaluateRelation(const_cast<Constant*>(V1),
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 8a1ae1eeca..621e2ca94b 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -1419,7 +1419,7 @@ Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode,
assert(C1->getType() == C2->getType() &&
"Operand types in binary constant expression should match");
- if (ReqTy == C1->getType() || (Instruction::isRelational(Opcode) &&
+ if (ReqTy == C1->getType() || (Instruction::isComparison(Opcode) &&
ReqTy == Type::BoolTy))
if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2))
return FC; // Fold a few common cases...
@@ -1462,7 +1462,7 @@ Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) {
}
#endif
- if (Instruction::isRelational(Opcode))
+ if (Instruction::isComparison(Opcode))
return getTy(Type::BoolTy, Opcode, C1, C2);
else
return getTy(C1->getType(), Opcode, C1, C2);
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index ab4aaac745..b2951461d7 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -200,9 +200,9 @@ bool Instruction::isCommutative(unsigned op) {
}
}
-/// isRelational - Return true if the instruction is a Set* instruction:
+/// isComparison - Return true if the instruction is a Set* instruction:
///
-bool Instruction::isRelational(unsigned op) {
+bool Instruction::isComparison(unsigned op) {
switch (op) {
case SetEQ:
case SetNE: