mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Move getSubsectionInsertionPoint to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238320 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -290,37 +290,6 @@ MCEncodedFragmentWithFixups::~MCEncodedFragmentWithFixups() {
|
||||
|
||||
MCSectionData::MCSectionData(MCSection &Section) : Section(&Section) {}
|
||||
|
||||
MCSectionData::iterator
|
||||
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
|
||||
if (Subsection == 0 && SubsectionFragmentMap.empty())
|
||||
return end();
|
||||
|
||||
SmallVectorImpl<std::pair<unsigned, MCFragment *> >::iterator MI =
|
||||
std::lower_bound(SubsectionFragmentMap.begin(), SubsectionFragmentMap.end(),
|
||||
std::make_pair(Subsection, (MCFragment *)nullptr));
|
||||
bool ExactMatch = false;
|
||||
if (MI != SubsectionFragmentMap.end()) {
|
||||
ExactMatch = MI->first == Subsection;
|
||||
if (ExactMatch)
|
||||
++MI;
|
||||
}
|
||||
iterator IP;
|
||||
if (MI == SubsectionFragmentMap.end())
|
||||
IP = end();
|
||||
else
|
||||
IP = MI->second;
|
||||
if (!ExactMatch && Subsection != 0) {
|
||||
// The GNU as documentation claims that subsections have an alignment of 4,
|
||||
// although this appears not to be the case.
|
||||
MCFragment *F = new MCDataFragment();
|
||||
SubsectionFragmentMap.insert(MI, std::make_pair(Subsection, F));
|
||||
getFragmentList().insert(IP, F);
|
||||
F->setParent(&getSection());
|
||||
}
|
||||
|
||||
return IP;
|
||||
}
|
||||
|
||||
/* *** */
|
||||
|
||||
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
|
||||
|
Reference in New Issue
Block a user