git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103715
91177308-0d34-0410-b5e6-
96231b3b80d8
/// Ordinal - The section index in the assemblers section list.
unsigned Ordinal;
+ /// LayoutOrder - The index of this section in the layout order.
+ unsigned LayoutOrder;
+
/// Alignment - The maximum alignment seen in this section.
unsigned Alignment;
unsigned getOrdinal() const { return Ordinal; }
void setOrdinal(unsigned Value) { Ordinal = Value; }
+ unsigned getLayoutOrder() const { return LayoutOrder; }
+ void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
+
/// @name Fragment Access
/// @{
// Create the layout object.
MCAsmLayout Layout(*this);
+ // Assign layout order indices.
+ for (unsigned i = 0, e = Layout.getSectionOrder().size(); i != e; ++i)
+ Layout.getSectionOrder()[i]->setLayoutOrder(i);
+
// Insert additional align fragments for concrete sections to explicitly pad
// the previous section to match their alignment requirements. This is for
// 'gas' compatibility, it shouldn't strictly be necessary.