[LegacyPassManager] Remove analysis P from AnUsageMap before deleting it in schedulePass.
authorCraig Topper <craig.topper@intel.com>
Mon, 20 Aug 2018 20:57:30 +0000 (20:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 20 Aug 2018 20:57:30 +0000 (20:57 +0000)
commit4ee28412a56d1ab47e06743f6cc7492aba1e91ad
tree8df44a801138089dfcdc522c0fe28ff1edaa60e5
parentcc3f630252c7290e6b093dae7a52c7ec14dee0e5
[LegacyPassManager] Remove analysis P from AnUsageMap before deleting it in schedulePass.

If we deem the analysis pass useless and delete it, we need to make sure we remove it from AnUsageMap. Otherwise we might allocate another pass in the freed memory. This will cause us to reuse the AnalysisUsage from the original pass instead of the new one.

Fixes PR38511

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

llvm-svn: 340210
llvm/lib/IR/LegacyPassManager.cpp