Expound upon this comparison!

llvm-svn: 124406
This commit is contained in:
Nick Lewycky 2011-01-27 19:51:31 +00:00
parent e801399372
commit e2d46d30ae
1 changed files with 2 additions and 0 deletions

View File

@ -468,6 +468,8 @@ bool FunctionComparator::Enumerate(const Value *V1, const Value *V2) {
if (C1->isNullValue() && C2->isNullValue() &&
isEquivalentType(C1->getType(), C2->getType()))
return true;
// Try bitcasting C2 to C1's type. If the bitcast is legal and returns C1
// then they must have equal bit patterns.
return C1->getType()->canLosslesslyBitCastTo(C2->getType()) &&
C1 == ConstantExpr::getBitCast(const_cast<Constant*>(C2), C1->getType());
}