[llvm-commits] [llvm] r103651 - /llvm/trunk/lib/MC/MCAssembler.cpp

Daniel Dunbar daniel at zuster.org
Wed May 12 14:47:55 PDT 2010


Author: ddunbar
Date: Wed May 12 16:47:55 2010
New Revision: 103651

URL: http://llvm.org/viewvc/llvm-project?rev=103651&view=rev
Log:
Simplify.

Modified:
    llvm/trunk/lib/MC/MCAssembler.cpp

Modified: llvm/trunk/lib/MC/MCAssembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=103651&r1=103650&r2=103651&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAssembler.cpp (original)
+++ llvm/trunk/lib/MC/MCAssembler.cpp Wed May 12 16:47:55 2010
@@ -459,11 +459,9 @@
     // Unless this section is virtual (where we are allowed to adjust the offset
     // freely), the padding goes in the previous section.
     if (!IsVirtual) {
-      // Find the previous non-virtual section.
-      iterator it = &SD;
-      assert(it != begin() && "Invalid initial section address!");
-      for (--it; getBackend().isVirtualSection(it->getSection()); --it) ;
-      Layout.setSectionFileSize(&*it, Layout.getSectionFileSize(&*it) + Pad);
+      assert(SectionOrderIndex && "Invalid initial section address!");
+      MCSectionData *Prev = Layout.getSectionOrder()[SectionOrderIndex - 1];
+      Layout.setSectionFileSize(Prev, Layout.getSectionFileSize(Prev) + Pad);
     }
 
     StartAddress += Pad;





More information about the llvm-commits mailing list