[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340210 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed