[llvm] [MC] Replace fragment ilist with singly-linked lists (PR #95077)

Alexey Karyakin via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 13:22:14 PDT 2024


================
@@ -58,12 +55,29 @@ class MCSection {
     BundleLockedAlignToEnd
   };
 
-  using FragmentListType = iplist<MCFragment>;
+  struct iterator {
+    MCFragment *F = nullptr;
+    iterator() = default;
+    explicit iterator(MCFragment *F) : F(F) {}
+    MCFragment &operator*() const { return *F; }
+    bool operator==(const iterator &O) const { return F == O.F; }
+    bool operator!=(const iterator &O) const { return F != O.F; }
+    iterator &operator++() {
+      F = F->Next;
+      return *this;
+    }
+    iterator operator++(int) { return iterator(F->Next); }
----------------
quic-akaryaki wrote:

This postfix increment operator does not change its own value. It does not seem to be used so far, though.

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


More information about the llvm-commits mailing list