diff options
author | Dan Gohman <dan433584@gmail.com> | 2013-02-12 18:44:43 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2013-02-12 18:44:43 +0000 |
commit | fd41de0b10ef8df3fd9ab125a884a11d5dc194a0 (patch) | |
tree | 6fd97e1eb25391da32e2e66b704c4d8b4d998406 /llvm/lib/Transforms | |
parent | d9010963457f5ec3f1e5838c9d64565088f0a15a (diff) | |
download | bcm5719-llvm-fd41de0b10ef8df3fd9ab125a884a11d5dc194a0.tar.gz bcm5719-llvm-fd41de0b10ef8df3fd9ab125a884a11d5dc194a0.zip |
Check that pointers are removed from maps before calling delete on the pointers,
for tidiness' sake.
llvm-svn: 174988
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/GVN.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index fae0a1f0e4e..0fe10960cc7 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -2371,8 +2371,8 @@ bool GVN::processBlock(BasicBlock *BB) { E = InstrsToErase.end(); I != E; ++I) { DEBUG(dbgs() << "GVN removed: " << **I << '\n'); if (MD) MD->removeInstruction(*I); - (*I)->eraseFromParent(); DEBUG(verifyRemoved(*I)); + (*I)->eraseFromParent(); } InstrsToErase.clear(); @@ -2504,8 +2504,8 @@ bool GVN::performPRE(Function &F) { // the PRE predecessor. This is typically because of loads which // are not value numbered precisely. if (!success) { - delete PREInstr; DEBUG(verifyRemoved(PREInstr)); + delete PREInstr; continue; } @@ -2551,8 +2551,8 @@ bool GVN::performPRE(Function &F) { DEBUG(dbgs() << "GVN PRE removed: " << *CurInst << '\n'); if (MD) MD->removeInstruction(CurInst); - CurInst->eraseFromParent(); DEBUG(verifyRemoved(CurInst)); + CurInst->eraseFromParent(); Changed = true; } } |