[llvm] r341412 - Fix a memory leak after rL341386.

Hiroshi Yamauchi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 14:28:22 PDT 2018


Author: yamauchi
Date: Tue Sep  4 14:28:22 2018
New Revision: 341412

URL: http://llvm.org/viewvc/llvm-project?rev=341412&view=rev
Log:
Fix a memory leak after rL341386.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51658

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

Modified: llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp?rev=341412&r1=341411&r2=341412&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/ControlHeightReduction.cpp Tue Sep  4 14:28:22 2018
@@ -1753,8 +1753,8 @@ BranchInst *CHR::createMergedBranch(Basi
          "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,




More information about the llvm-commits mailing list