Avoid "ambiguous 'else'" warning from gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86314 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeffrey Yasskin 2009-11-07 00:26:47 +00:00
parent 9d0b704e3e
commit 9beab3fe6f

View File

@ -213,11 +213,12 @@ static Constant *GetResultOfComparison(CmpInst::Predicate pred,
return ConstantExpr::getCompare(pred, CLHS, CRHS);
if (LHS == RHS)
if (isa<IntegerType>(LHS->getType()) || isa<PointerType>(LHS->getType()))
if (isa<IntegerType>(LHS->getType()) || isa<PointerType>(LHS->getType())) {
if (ICmpInst::isTrueWhenEqual(pred))
return ConstantInt::getTrue(LHS->getContext());
else
return ConstantInt::getFalse(LHS->getContext());
}
return 0;
}