diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 21:47:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 21:47:55 +0000 |
commit | 52f8dff671280dc13143ba2a5d09d2da243cbb0a (patch) | |
tree | 79102652bd073ed68ced5eecc8090b66a3a33681 /lib/MC/MCAssembler.cpp | |
parent | f0d17d2461a6458568672f611ba4a590d26b1e1a (diff) |
Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 106a0ed666..7bcce2e7e3 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -459,11 +459,9 @@ void MCAssembler::LayoutSection(MCAsmLayout &Layout, // 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; |