mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 07:58:23 +08:00
Address a memory leak in 254760
The issue appears to have been that the copy constructor of the SmallVector was being invoked and this was somehow leading to leaked memory. This patch avoids the symptom, but likely doesn't address the underlying problem. I'm still investigating the root cause, but wanted to avoid the memory leak in the mean time. Even with the underlying fix, avoiding the redundant allocation is worthwhile. llvm-svn: 254795
This commit is contained in:
@@ -264,12 +264,15 @@ private:
|
||||
// TODO: We could consider sorting the dependency arrays within the
|
||||
// AnalysisUsage (since they are conceptually unordered).
|
||||
ID.AddBoolean(AU.getPreservesAll());
|
||||
for (auto &Vec : {AU.getRequiredSet(), AU.getRequiredTransitiveSet(),
|
||||
AU.getPreservedSet(), AU.getUsedSet()}) {
|
||||
auto ProfileVec = [&](const SmallVectorImpl<AnalysisID>& Vec) {
|
||||
ID.AddInteger(Vec.size());
|
||||
for(AnalysisID AID : Vec)
|
||||
ID.AddPointer(AID);
|
||||
}
|
||||
};
|
||||
ProfileVec(AU.getRequiredSet());
|
||||
ProfileVec(AU.getRequiredTransitiveSet());
|
||||
ProfileVec(AU.getPreservedSet());
|
||||
ProfileVec(AU.getUsedSet());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user