[llvm] r373494 - Fix: Actually erase remove the elements from AssumeHandles

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 10:35:06 PDT 2019


Author: hiraditya
Date: Wed Oct  2 10:35:06 2019
New Revision: 373494

URL: http://llvm.org/viewvc/llvm-project?rev=373494&view=rev
Log:
Fix: Actually erase remove the elements from AssumeHandles

Reviewers: sdmitriev, tejohnson

Reviewed by: tejohnson

Subscribers: llvm-commits

Tags: #llvm

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

Modified:
    llvm/trunk/lib/Analysis/AssumptionCache.cpp

Modified: llvm/trunk/lib/Analysis/AssumptionCache.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionCache.cpp?rev=373494&r1=373493&r2=373494&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AssumptionCache.cpp (original)
+++ llvm/trunk/lib/Analysis/AssumptionCache.cpp Wed Oct  2 10:35:06 2019
@@ -130,7 +130,10 @@ void AssumptionCache::unregisterAssumpti
     if (AVI != AffectedValues.end())
       AffectedValues.erase(AVI);
   }
-  remove_if(AssumeHandles, [CI](WeakTrackingVH &VH) { return CI == VH; });
+
+  AssumeHandles.erase(
+      remove_if(AssumeHandles, [CI](WeakTrackingVH &VH) { return CI == VH; }),
+      AssumeHandles.end());
 }
 
 void AssumptionCache::AffectedValueCallbackVH::deleted() {




More information about the llvm-commits mailing list