diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-09-17 19:14:47 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-09-17 19:14:47 +0000 |
| commit | e1496fbb3307c639c9deabe144c7a2e937e1ccef (patch) | |
| tree | 6fd8e59236030d30bf856b0510ea8222beea77f0 /llvm/lib/VMCore | |
| parent | 241211939d53bdd7720bdc3d80c9ca04c2afef7d (diff) | |
| download | bcm5719-llvm-e1496fbb3307c639c9deabe144c7a2e937e1ccef.tar.gz bcm5719-llvm-e1496fbb3307c639c9deabe144c7a2e937e1ccef.zip | |
Add new SetCondInst::isRelational/isEquality methods. Rename
Instruction::isRelational to Instruction::isComparison.
llvm-svn: 30444
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/ConstantFolding.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Instruction.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/ConstantFolding.cpp b/llvm/lib/VMCore/ConstantFolding.cpp index 2263d5ed83d..32945c290f2 100644 --- a/llvm/lib/VMCore/ConstantFolding.cpp +++ b/llvm/lib/VMCore/ConstantFolding.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/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 8a1ae1eeca2..621e2ca94bf 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/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/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp index ab4aaac7450..b2951461d7c 100644 --- a/llvm/lib/VMCore/Instruction.cpp +++ b/llvm/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: |

