mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Instruction::isIdenticalToWhenDefined(): Check getNumOperands() in advance of std::equal(op) to appease MSVC Debug build.
MSVC Debug build is confused with (possibly invalid) op_begin(), if op_begin() == op_end(). llvm-svn: 210000
This commit is contained in:
parent
80b2be2884
commit
bc730b170e
@ -331,6 +331,10 @@ bool Instruction::isIdenticalToWhenDefined(const Instruction *I) const {
|
||||
getType() != I->getType())
|
||||
return false;
|
||||
|
||||
// If both instructions have no operands, they are identical.
|
||||
if (getNumOperands() == 0 && I->getNumOperands() == 0)
|
||||
return haveSameSpecialState(this, I);
|
||||
|
||||
// We have two instructions of identical opcode and #operands. Check to see
|
||||
// if all operands are the same.
|
||||
if (!std::equal(op_begin(), op_end(), I->op_begin()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user