summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LegacyPassManager.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-12-04 23:48:19 +0000
committerPhilip Reames <listmail@philipreames.com>2015-12-04 23:48:19 +0000
commit000f77d72815e45c40c5382717f8a7ab8bbf2d94 (patch)
treebea15e4ea748641aab5f224d91c4b439d2cc8f49 /llvm/lib/IR/LegacyPassManager.cpp
parentbae7e75959c1897e54343db410baf2bb7cc48e93 (diff)
downloadbcm5719-llvm-000f77d72815e45c40c5382717f8a7ab8bbf2d94.tar.gz
bcm5719-llvm-000f77d72815e45c40c5382717f8a7ab8bbf2d94.zip
[PassManager] Ensure destructors of cached AnalysisUsage objects are run
In 254760, I introduced the usage of a BumpPtrAllocator for the AnalysisUsage instances held by the PassManger. This turns out to have been incorrect since a BumpPtrAllocator does not run the destructors of objects when deallocating memory. Since a few of our SmallVector's had grown beyond their small size, we end up with some leaked memory. We need to use a SpecificBumpPtrAllocator instead. llvm-svn: 254803
Diffstat (limited to 'llvm/lib/IR/LegacyPassManager.cpp')
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index 08e8906e88d..f2e0c7d32c0 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -589,7 +589,7 @@ AnalysisUsage *PMTopLevelManager::findAnalysisUsage(Pass *P) {
if (auto *N = UniqueAnalysisUsages.FindNodeOrInsertPos(ID, IP))
Node = N;
else {
- Node = new (AUFoldingSetNodeAllocator) AUFoldingSetNode(AU);
+ Node = new (AUFoldingSetNodeAllocator.Allocate()) AUFoldingSetNode(AU);
UniqueAnalysisUsages.InsertNode(Node, IP);
}
assert(Node && "cached analysis usage must be non null");
OpenPOWER on IntegriCloud