Add AssertingVH which makes PR7647 break consistently.

llvm-svn: 108401
This commit is contained in:
Eli Friedman 2010-07-15 04:46:14 +00:00
parent e4be4308a9
commit fd473a746c
1 changed files with 3 additions and 1 deletions

View File

@ -443,6 +443,8 @@ void llvm::ReplaceAndSimplifyAllUses(Instruction *From, Value *To,
// FromHandle - This keeps a weakvh on the from value so that we can know if
// it gets deleted out from under us in a recursive simplification.
WeakVH FromHandle(From);
// Double-check that To isn't deleted.
AssertingVH<> CheckedTo = To;
while (!From->use_empty()) {
// Update the instruction to use the new value.