Insert MCSectionData into the section list directly in getOrCreateSectionData.

Removing the logic from the constructor will make it easier to merge
MCSectionData and MCSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238155 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2015-05-25 20:39:23 +00:00
parent 002c5281ef
commit 0d46e8a420
2 changed files with 6 additions and 8 deletions

View File

@ -566,7 +566,7 @@ private:
public:
// Only for use as sentinel.
MCSectionData();
MCSectionData(MCSection &Section, MCAssembler *A = nullptr);
MCSectionData(MCSection &Section);
MCSection &getSection() const { return *Section; }
@ -971,8 +971,10 @@ public:
if (Created)
*Created = !Entry;
if (!Entry)
Entry = new MCSectionData(Section, this);
if (!Entry) {
Entry = new MCSectionData(Section);
Sections.push_back(Entry);
}
return *Entry;
}

View File

@ -292,11 +292,7 @@ MCEncodedFragmentWithFixups::~MCEncodedFragmentWithFixups() {
MCSectionData::MCSectionData() : Section(nullptr) {}
MCSectionData::MCSectionData(MCSection &Section, MCAssembler *A)
: Section(&Section) {
if (A)
A->getSectionList().push_back(this);
}
MCSectionData::MCSectionData(MCSection &Section) : Section(&Section) {}
MCSectionData::iterator
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {