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 | 7d73564b8211f52541e46b257d8fc8a60207c0d4 (patch) | |
tree | 8e2d3fa56e09c26b5a32e3f25206eec5f8bd8ea1 /llvm/lib/MC/MCAssembler.cpp | |
parent | 6cdc2c1bc8cc0d2690cac483086ed75e4df98e46 (diff) | |
download | bcm5719-llvm-7d73564b8211f52541e46b257d8fc8a60207c0d4.tar.gz bcm5719-llvm-7d73564b8211f52541e46b257d8fc8a60207c0d4.zip |
Simplify.
llvm-svn: 103651
Diffstat (limited to 'llvm/lib/MC/MCAssembler.cpp')
-rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 106a0ed666c..7bcce2e7e34 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/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; |