mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
PHI nodes are not allowed to exist with zero incoming values, check that
there aren't any like this. llvm-svn: 4044
This commit is contained in:
parent
6932399f9b
commit
53a414c3c4
@ -17,6 +17,7 @@
|
|||||||
// * Only phi nodes can be self referential: 'add int %0, %0 ; <int>:0' is bad
|
// * Only phi nodes can be self referential: 'add int %0, %0 ; <int>:0' is bad
|
||||||
// * PHI nodes must have an entry for each predecessor, with no extras.
|
// * PHI nodes must have an entry for each predecessor, with no extras.
|
||||||
// * PHI nodes must be the first thing in a basic block, all grouped together
|
// * PHI nodes must be the first thing in a basic block, all grouped together
|
||||||
|
// * PHI nodes must have at least one entry
|
||||||
// * All basic blocks should only end with terminator insts, not contain them
|
// * All basic blocks should only end with terminator insts, not contain them
|
||||||
// * The entry node to a function must not have predecessors
|
// * The entry node to a function must not have predecessors
|
||||||
// * All Instructions must be embeded into a basic block
|
// * All Instructions must be embeded into a basic block
|
||||||
@ -258,6 +259,12 @@ void Verifier::visitPHINode(PHINode &PN) {
|
|||||||
"PHI nodes not grouped at top of basic block!",
|
"PHI nodes not grouped at top of basic block!",
|
||||||
&PN, PN.getParent());
|
&PN, PN.getParent());
|
||||||
|
|
||||||
|
// Ensure that PHI nodes have at least one entry!
|
||||||
|
Assert1(PN.getNumIncomingValues() != 0,
|
||||||
|
"PHI nodes must have at least one entry. If the block is dead, "
|
||||||
|
"the PHI should be removed!",
|
||||||
|
&PN);
|
||||||
|
|
||||||
std::vector<BasicBlock*> Preds(pred_begin(PN.getParent()),
|
std::vector<BasicBlock*> Preds(pred_begin(PN.getParent()),
|
||||||
pred_end(PN.getParent()));
|
pred_end(PN.getParent()));
|
||||||
// Loop over all of the incoming values, make sure that there are
|
// Loop over all of the incoming values, make sure that there are
|
||||||
|
Loading…
Reference in New Issue
Block a user