summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-05-25 23:48:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-05-25 23:48:22 +0000
commit8324c2f8bee4d6d78005dbabaafb27bc11645266 (patch)
tree1eb3657237f57a20d30287f566502744d3232948 /llvm/lib
parenta554c05d95dfe406de1613c78ab4eebf2c030adf (diff)
downloadbcm5719-llvm-8324c2f8bee4d6d78005dbabaafb27bc11645266.tar.gz
bcm5719-llvm-8324c2f8bee4d6d78005dbabaafb27bc11645266.zip
Store a MCSection in MCFragment.
Part of the work to merge MCSectionData into MCSection. llvm-svn: 238160
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp6
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp5
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp5
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp2
-rw-r--r--llvm/lib/MC/WinCOFFStreamer.cpp6
5 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index fe4e22d2104..1d8f70309a1 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -272,7 +272,7 @@ MCFragment::MCFragment() : Kind(FragmentType(~0)) {
MCFragment::~MCFragment() {
}
-MCFragment::MCFragment(FragmentType Kind, MCSectionData *Parent)
+MCFragment::MCFragment(FragmentType Kind, MCSection *Parent)
: Kind(Kind), Parent(Parent), Atom(nullptr), Offset(~UINT64_C(0)) {
if (Parent)
Parent->getFragmentList().push_back(this);
@@ -317,7 +317,7 @@ MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
MCFragment *F = new MCDataFragment();
SubsectionFragmentMap.insert(MI, std::make_pair(Subsection, F));
getFragmentList().insert(IP, F);
- F->setParent(this);
+ F->setParent(&getSection());
}
return IP;
@@ -859,7 +859,7 @@ void MCAssembler::Finish() {
// Create dummy fragments to eliminate any empty sections, this simplifies
// layout.
if (it->getFragmentList().empty())
- new MCDataFragment(&it->getSectionData());
+ new MCDataFragment(&*it);
it->setOrdinal(SectionIndex++);
}
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 23546cc085d..cad5d93e459 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -644,9 +644,10 @@ void MCELFStreamer::Flush() {
MCSection &Section = Symbol.getSection();
MCSectionData &SectData = getAssembler().getOrCreateSectionData(Section);
- new MCAlignFragment(ByteAlignment, 0, 1, ByteAlignment, &SectData);
+ new MCAlignFragment(ByteAlignment, 0, 1, ByteAlignment,
+ &SectData.getSection());
- MCFragment *F = new MCFillFragment(0, 0, Size, &SectData);
+ MCFragment *F = new MCFillFragment(0, 0, Size, &SectData.getSection());
Symbol.getData().setFragment(F);
// Update the maximum alignment of the section if necessary.
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 3742a733d26..8fb9711178a 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -418,9 +418,10 @@ void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
// Emit an align fragment if necessary.
if (ByteAlignment != 1)
- new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, &SectData);
+ new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment,
+ &SectData.getSection());
- MCFragment *F = new MCFillFragment(0, 0, Size, &SectData);
+ MCFragment *F = new MCFillFragment(0, 0, Size, &SectData.getSection());
SD.setFragment(F);
AssignSection(Symbol, Section);
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 8584a79a8d1..e6fd7adbfa9 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -43,7 +43,7 @@ void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) {
if (!F) {
F = new MCDataFragment();
CurSectionData->getFragmentList().insert(CurInsertionPoint, F);
- F->setParent(CurSectionData);
+ F->setParent(&CurSectionData->getSection());
}
for (MCSymbolData *SD : PendingLabels) {
SD->setFragment(F);
diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp
index 20c909db84a..eb98eba1711 100644
--- a/llvm/lib/MC/WinCOFFStreamer.cpp
+++ b/llvm/lib/MC/WinCOFFStreamer.cpp
@@ -231,10 +231,10 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
if (ByteAlignment != 1)
new MCAlignFragment(ByteAlignment, /*Value=*/0, /*ValueSize=*/0,
- ByteAlignment, &SectionData);
+ ByteAlignment, &SectionData.getSection());
- MCFillFragment *Fragment =
- new MCFillFragment(/*Value=*/0, /*ValueSize=*/0, Size, &SectionData);
+ MCFillFragment *Fragment = new MCFillFragment(
+ /*Value=*/0, /*ValueSize=*/0, Size, &SectionData.getSection());
SD.setFragment(Fragment);
}
OpenPOWER on IntegriCloud