aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-06-08 15:51:44 -0700
committerFangrui Song <i@maskray.me>2024-06-08 15:51:44 -0700
commitdcb71c06c7b059e313f22e46bc9c41343a03f1eb (patch)
tree17e96b4f1d576280853effe8d2978b42aad2fa67 /llvm/lib/MC/MCContext.cpp
parent2e482b25329433a61fee2e22f4ea00775e7e7ec7 (diff)
downloadllvm-dcb71c06c7b059e313f22e46bc9c41343a03f1eb.zip
llvm-dcb71c06c7b059e313f22e46bc9c41343a03f1eb.tar.gz
llvm-dcb71c06c7b059e313f22e46bc9c41343a03f1eb.tar.bz2
[MC] Simplify Sec.getFragmentList().insert(Sec.begin(), F). NFC
Decrease the uses of getFragmentList() to make it easier to change the fragment list representation.
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index f027eb6..771ca9c 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -498,7 +498,7 @@ MCSectionELF *MCContext::createELFSectionImpl(StringRef Section, unsigned Type,
R, LinkedToSym);
auto *F = new MCDataFragment();
- Ret->getFragmentList().insert(Ret->begin(), F);
+ Ret->addFragment(*F);
F->setParent(Ret);
R->setFragment(F);
@@ -772,7 +772,7 @@ MCSectionWasm *MCContext::getWasmSection(const Twine &Section, SectionKind Kind,
Entry.second = Result;
auto *F = new MCDataFragment();
- Result->getFragmentList().insert(Result->begin(), F);
+ Result->addFragment(*F);
F->setParent(Result);
Begin->setFragment(F);
@@ -838,7 +838,7 @@ MCSectionXCOFF *MCContext::getXCOFFSection(
Entry.second = Result;
auto *F = new MCDataFragment();
- Result->getFragmentList().insert(Result->begin(), F);
+ Result->addFragment(*F);
F->setParent(Result);
if (Begin)
@@ -861,7 +861,7 @@ MCSectionSPIRV *MCContext::getSPIRVSection() {
MCSectionSPIRV(SectionKind::getText(), Begin);
auto *F = new MCDataFragment();
- Result->getFragmentList().insert(Result->begin(), F);
+ Result->addFragment(*F);
F->setParent(Result);
return Result;
@@ -884,7 +884,7 @@ MCSectionDXContainer *MCContext::getDXContainerSection(StringRef Section,
// The first fragment will store the header
auto *F = new MCDataFragment();
- MapIt->second->getFragmentList().insert(MapIt->second->begin(), F);
+ MapIt->second->addFragment(*F);
F->setParent(MapIt->second);
return MapIt->second;