summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2018-09-04 21:28:22 +0000
committerHiroshi Yamauchi <yamauchi@google.com>2018-09-04 21:28:22 +0000
commitbd897a02a0642b11eb3f5dbc6346e32c7fedce4d (patch)
treef3237ce6ce46075e833d793036a080bd73e6a374
parent1b55b2be7ee4c5f992447ef6ca9856b8224692ec (diff)
downloadbcm5719-llvm-bd897a02a0642b11eb3f5dbc6346e32c7fedce4d.tar.gz
bcm5719-llvm-bd897a02a0642b11eb3f5dbc6346e32c7fedce4d.zip
Fix a memory leak after rL341386.
Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51658 llvm-svn: 341412
-rw-r--r--llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
index 9a27b4a51e5..5b1f499eacc 100644
--- a/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
@@ -1753,8 +1753,8 @@ BranchInst *CHR::createMergedBranch(BasicBlock *PreEntryBlock,
"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,
OpenPOWER on IntegriCloud