aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/MC/MCSection.h12
-rw-r--r--llvm/lib/MC/MCContext.cpp3
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp4
-rw-r--r--llvm/lib/MC/MCWinCOFFStreamer.cpp4
4 files changed, 4 insertions, 19 deletions
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index e8e6575..58ba34c 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -198,18 +198,6 @@ public:
iterator end() const { return {}; }
bool empty() const { return !CurFragList->Head; }
- void addFragment(MCFragment &F) {
- // The formal layout order will be finalized in MCAssembler::layout.
- if (CurFragList->Tail) {
- CurFragList->Tail->Next = &F;
- F.setLayoutOrder(CurFragList->Tail->getLayoutOrder() + 1);
- } else {
- CurFragList->Head = &F;
- assert(F.getLayoutOrder() == 0);
- }
- CurFragList->Tail = &F;
- }
-
void dump() const;
virtual void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 1f23705..2fe8369 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -201,7 +201,8 @@ MCDataFragment *MCContext::allocInitialFragment(MCSection &Sec) {
assert(!Sec.curFragList()->Head);
auto *F = allocFragment<MCDataFragment>();
F->setParent(&Sec);
- Sec.addFragment(*F);
+ Sec.curFragList()->Head = F;
+ Sec.curFragList()->Tail = F;
return F;
}
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index e2f6508..d67b958 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -596,9 +596,7 @@ void MCMachOStreamer::createAddrSigSection() {
MCSection *AddrSigSection =
Asm.getContext().getObjectFileInfo()->getAddrSigSection();
changeSection(AddrSigSection);
- auto *Frag = getContext().allocFragment<MCDataFragment>();
- Frag->setParent(AddrSigSection);
- AddrSigSection->addFragment(*Frag);
+ auto *Frag = cast<MCDataFragment>(AddrSigSection->curFragList()->Head);
// We will generate a series of pointer-sized symbol relocations at offset
// 0x0. Set the section size to be large enough to contain a single pointer
// (instead of emitting a zero-sized section) so these relocations are
diff --git a/llvm/lib/MC/MCWinCOFFStreamer.cpp b/llvm/lib/MC/MCWinCOFFStreamer.cpp
index c4c3570..538244c 100644
--- a/llvm/lib/MC/MCWinCOFFStreamer.cpp
+++ b/llvm/lib/MC/MCWinCOFFStreamer.cpp
@@ -205,9 +205,7 @@ void MCWinCOFFStreamer::emitCOFFSafeSEH(MCSymbol const *Symbol) {
changeSection(SXData);
SXData->ensureMinAlignment(Align(4));
- auto *F = getContext().allocFragment<MCSymbolIdFragment>(Symbol);
- F->setParent(SXData);
- SXData->addFragment(*F);
+ insert(getContext().allocFragment<MCSymbolIdFragment>(Symbol));
getAssembler().registerSymbol(*Symbol);
CSymbol->setIsSafeSEH();