[llvm] r262682 - Fix a memory leak.
Easwaran Raman via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 3 17:18:41 PST 2016
Author: eraman
Date: Thu Mar 3 19:18:40 2016
New Revision: 262682
URL: http://llvm.org/viewvc/llvm-project?rev=262682&view=rev
Log:
Fix a memory leak.
Modified:
llvm/trunk/lib/Analysis/InlineCost.cpp
Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=262682&r1=262681&r2=262682&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Thu Mar 3 19:18:40 2016
@@ -1600,5 +1600,8 @@ BlockFrequencyInfo *BlockFrequencyAnalys
/// \brief Invalidate BlockFrequencyInfo for a function.
void BlockFrequencyAnalysis::invalidateBlockFrequencyInfo(Function *F) {
- BFM.erase(F);
+ if (BFM.count(F)) {
+ delete BFM[F];
+ BFM.erase(F);
+ }
}
More information about the llvm-commits
mailing list