[llvm-commits] [llvm] r103715 - in /llvm/trunk: include/llvm/MC/MCAssembler.h lib/MC/MCAssembler.cpp
Daniel Dunbar
daniel at zuster.org
Thu May 13 08:17:26 PDT 2010
Author: ddunbar
Date: Thu May 13 10:17:26 2010
New Revision: 103715
URL: http://llvm.org/viewvc/llvm-project?rev=103715&view=rev
Log:
MC: Add section layout order indices to MCSectionData.
Modified:
llvm/trunk/include/llvm/MC/MCAssembler.h
llvm/trunk/lib/MC/MCAssembler.cpp
Modified: llvm/trunk/include/llvm/MC/MCAssembler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAssembler.h?rev=103715&r1=103714&r2=103715&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAssembler.h (original)
+++ llvm/trunk/include/llvm/MC/MCAssembler.h Thu May 13 10:17:26 2010
@@ -392,6 +392,9 @@
/// 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;
@@ -426,6 +429,9 @@
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
/// @{
Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=103715&r1=103714&r2=103715&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Thu May 13 10:17:26 2010
@@ -601,6 +601,10 @@
// 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.
More information about the llvm-commits
mailing list