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

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 23:28:21 PDT 2024


================
@@ -107,6 +115,11 @@ class MCSection {
   };
   SmallVector<PendingLabel, 2> PendingLabels;
 
+  // Mapping from subsection number to fragment list. At layout time, the
+  // subsection 0 list is replaced with concatenated fragments from all
+  // subsections.
+  SmallVector<std::pair<unsigned, std::unique_ptr<FragList>>, 1> Subsections;
----------------
aengelke wrote:

Why a unique_ptr? Whenever Subsections is updated, also CurFragList is updated, so no dangling pointer could occur?

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


More information about the llvm-commits mailing list