[llvm] [EquivalenceClasses] Introduce erase member function (PR #134660)

donald chen via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 05:53:11 PDT 2025


================
@@ -220,6 +220,46 @@ template <class ElemTy> class EquivalenceClasses {
     return *ECV;
   }
 
+  /// erase - Erase a value from the union/find set, return if erase succeed.
+  bool erase(const ElemTy &V) {
+    if (!TheMapping.contains(V))
+      return false;
+    const ECValue *Cur = TheMapping[V];
+    const ECValue *Next = Cur->getNext();
+    if (Cur->isLeader()) {
----------------
cxy-1993 wrote:

DONE

https://github.com/llvm/llvm-project/pull/134660


More information about the llvm-commits mailing list