1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Detect problems with PHI node operands!

llvm-svn: 9916
This commit is contained in:
Chris Lattner 2003-11-12 07:13:37 +00:00
parent 463dc76802
commit e72202b5b8

View File

@ -340,6 +340,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());
// Check that all of the operands of the PHI node have the same type as the
// result.
for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i)
Assert1(PN.getType() == PN.getIncomingValue(i)->getType(),
"PHI node operands are not the same type as the result!", &PN);
// All other PHI node constraints are checked in the visitBasicBlock method. // All other PHI node constraints are checked in the visitBasicBlock method.
visitInstruction(PN); visitInstruction(PN);