// condition.
auto* BB = UsageInst->getParent();
auto* InsertPoint = UsageInst->getNextNode();
+ while (dyn_cast<PHINode>(InsertPoint)) {
+ InsertPoint = InsertPoint->getNextNode();
+ }
IRBuilder<true, NoFolder> Builder(InsertPoint);
// First thing is to cast 'UsageInst' to an integer type if necessary.
Value* AndTarget = nullptr;
"PHI nodes must have at least one entry. If the block is dead, "
"the PHI should be removed!",
PN);
+ if (PN->getNumIncomingValues() != Preds.size()) {
+ dbgs() << "Problematic function: \n" << *PN->getParent()->getParent() << "\n";
+ dbgs() << "Problematic block: \n" << *PN->getParent() << "\n";
+ }
Assert(PN->getNumIncomingValues() == Preds.size(),
"PHINode should have one entry for each predecessor of its "
"parent basic block!",