FragmentListType Fragments;
MCSection *Section;
- /// LayoutOrder - The index of this section in the layout order.
- unsigned LayoutOrder;
-
/// \brief Keeping track of bundle-locked state.
BundleLockStateType BundleLockState;
bool hasInstructions() const { return HasInstructions; }
void setHasInstructions(bool Value) { HasInstructions = Value; }
- unsigned getLayoutOrder() const { return LayoutOrder; }
- void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
-
/// \name Fragment Access
/// @{
unsigned Alignment = 1;
/// The section index in the assemblers section list.
unsigned Ordinal = 0;
+ /// The index of this section in the layout order.
+ unsigned LayoutOrder;
protected:
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
unsigned getOrdinal() const { return Ordinal; }
void setOrdinal(unsigned Value) { Ordinal = Value; }
+ unsigned getLayoutOrder() const { return LayoutOrder; }
+ void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
+
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
const MCExpr *Subsection) const = 0;
// Assign layout order indices to sections and fragments.
for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i) {
MCSectionData *SD = Layout.getSectionOrder()[i];
- SD->setLayoutOrder(i);
+ SD->getSection().setLayoutOrder(i);
unsigned FragmentIndex = 0;
for (MCSectionData::iterator iFrag = SD->begin(), iFragEnd = SD->end();
uint64_t MachObjectWriter::getPaddingSize(const MCSectionData *SD,
const MCAsmLayout &Layout) const {
uint64_t EndAddr = getSectionAddress(SD) + Layout.getSectionAddressSize(SD);
- unsigned Next = SD->getLayoutOrder() + 1;
+ unsigned Next = SD->getSection().getLayoutOrder() + 1;
if (Next >= Layout.getSectionOrder().size())
return 0;