[PATCH] D51658: Fix a memory leak after rL341386.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 14:29:31 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL341412: Fix a memory leak after rL341386. (authored by yamauchi, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D51658

Files:
  llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp


Index: llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -1753,8 +1753,8 @@
          "NewEntryBlock's only pred must be EntryBlock");
   assert(VMap.find(NewEntryBlock) != VMap.end() &&
          "NewEntryBlock must have been copied");
-  OldBR->removeFromParent();
   OldBR->dropAllReferences();
+  OldBR->eraseFromParent();
   // The true predicate is a placeholder. It will be replaced later in
   // fixupBranchesAndSelects().
   BranchInst *NewBR = BranchInst::Create(NewEntryBlock,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51658.163923.patch
Type: text/x-patch
Size: 725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/34908cb8/attachment.bin>


More information about the llvm-commits mailing list