[llvm] r353804 - Delete blocks from DTU to avoid dangling pointers

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 00:10:29 PST 2019


Author: mkazantsev
Date: Tue Feb 12 00:10:29 2019
New Revision: 353804

URL: http://llvm.org/viewvc/llvm-project?rev=353804&view=rev
Log:
Delete blocks from DTU to avoid dangling pointers

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp?rev=353804&r1=353803&r2=353804&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp Tue Feb 12 00:10:29 2019
@@ -422,7 +422,7 @@ private:
     DTU.applyUpdates(DTUpdates);
     DTUpdates.clear();
     for (auto *BB : DeadLoopBlocks)
-      BB->eraseFromParent();
+      DTU.deleteBB(BB);
 
     NumLoopBlocksDeleted += DeadLoopBlocks.size();
   }




More information about the llvm-commits mailing list