[llvm] [MC] Add MCFragment allocation helpers (PR #95197)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 10:15:18 PDT 2024


================
@@ -195,6 +195,15 @@ MCInst *MCContext::createMCInst() {
   return new (MCInstAllocator.Allocate()) MCInst;
 }
 
+// Allocate the initial MCDataFragment for the begin symbol.
+MCDataFragment *MCContext::allocInitialFragment(MCSection &Sec) {
+  assert(!Sec.curFragList()->Head);
+  auto *F = allocFragment<MCDataFragment>();
----------------
MaskRay wrote:

Yes, I plan to remove the `Parent` parameter.

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


More information about the llvm-commits mailing list