mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 05:12:20 +00:00
Move asserts from PHINode::addIncoming to PHINode::setIncoming*
We had asserts in PHINode::addIncoming to check that the value types matched the type of the PHI, and that the associated BB was not null. These did not catch, however, later uses of setIncomingValue and setIncomingBlock (which are called by addIncoming as well). Moving the asserts to PHINode::setIncoming* provides better coverage. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a0a960468
commit
6adacc9233
@ -2405,6 +2405,9 @@ public:
|
||||
return getOperand(i);
|
||||
}
|
||||
void setIncomingValue(unsigned i, Value *V) {
|
||||
assert(V && "PHI node got a null value!");
|
||||
assert(getType() == V->getType() &&
|
||||
"All operands to PHI node must be the same type as the PHI node!");
|
||||
setOperand(i, V);
|
||||
}
|
||||
static unsigned getOperandNumForIncomingValue(unsigned i) {
|
||||
@ -2436,16 +2439,13 @@ public:
|
||||
}
|
||||
|
||||
void setIncomingBlock(unsigned i, BasicBlock *BB) {
|
||||
assert(BB && "PHI node got a null basic block!");
|
||||
block_begin()[i] = BB;
|
||||
}
|
||||
|
||||
/// addIncoming - Add an incoming value to the end of the PHI list
|
||||
///
|
||||
void addIncoming(Value *V, BasicBlock *BB) {
|
||||
assert(V && "PHI node got a null value!");
|
||||
assert(BB && "PHI node got a null basic block!");
|
||||
assert(getType() == V->getType() &&
|
||||
"All operands to PHI node must be the same type as the PHI node!");
|
||||
if (getNumOperands() == ReservedSpace)
|
||||
growOperands(); // Get more space!
|
||||
// Initialize some new operands.
|
||||
|
Loading…
x
Reference in New Issue
Block a user