summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-22 20:48:30 +0000
committerChris Lattner <sabre@nondot.org>2003-06-22 20:48:30 +0000
commit22ced56476d7bd909d6afb9da4085da026fd2fcc (patch)
tree72afba93933f7bb153736ec9303fd3d3d07bd72c /llvm/lib/VMCore/Constants.cpp
parent92963de6fa5a2d4c9c37ff9399634e95bce61f13 (diff)
downloadbcm5719-llvm-22ced56476d7bd909d6afb9da4085da026fd2fcc.tar.gz
bcm5719-llvm-22ced56476d7bd909d6afb9da4085da026fd2fcc.zip
Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll
llvm-svn: 6857
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
-rw-r--r--llvm/lib/VMCore/Constants.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index afe494e9bbf..935c2938c22 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -243,8 +243,14 @@ ConstantExpr::ConstantExpr(unsigned Opcode, Constant *C, const Type *Ty)
Operands.push_back(Use(C, this));
}
+static bool isSetCC(unsigned Opcode) {
+ return Opcode == Instruction::SetEQ || Opcode == Instruction::SetNE ||
+ Opcode == Instruction::SetLT || Opcode == Instruction::SetGT ||
+ Opcode == Instruction::SetLE || Opcode == Instruction::SetGE;
+}
+
ConstantExpr::ConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
- : Constant(C1->getType()), iType(Opcode) {
+ : Constant(isSetCC(Opcode) ? Type::BoolTy : C1->getType()), iType(Opcode) {
Operands.push_back(Use(C1, this));
Operands.push_back(Use(C2, this));
}
OpenPOWER on IntegriCloud