diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-25 18:16:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-25 18:16:38 +0000 |
commit | 25d114b2b258c017b51d40aaf95a9681bb081d3a (patch) | |
tree | 6bf5915aae71362a2310922899aa67838b831c28 /llvm/lib/MC | |
parent | bb4978fbae6933b11c050b5d024e543e1a86f725 (diff) | |
download | bcm5719-llvm-25d114b2b258c017b51d40aaf95a9681bb081d3a.tar.gz bcm5719-llvm-25d114b2b258c017b51d40aaf95a9681bb081d3a.zip |
MC: Sink Section address assignment into LayoutSection.
llvm-svn: 99528
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCAssembler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp index 5190239f5a3..c0ec04df095 100644 --- a/llvm/lib/MC/MCAssembler.cpp +++ b/llvm/lib/MC/MCAssembler.cpp @@ -365,9 +365,11 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout, } void MCAssembler::LayoutSection(MCSectionData &SD, - MCAsmLayout &Layout) { - uint64_t Address, StartAddress = Address = Layout.getSectionAddress(&SD); + MCAsmLayout &Layout, + uint64_t StartAddress) { + Layout.setSectionAddress(&SD, StartAddress); + uint64_t Address = StartAddress; for (MCSectionData::iterator it = SD.begin(), ie = SD.end(); it != ie; ++it) { MCFragment &F = *it; @@ -690,8 +692,7 @@ bool MCAssembler::LayoutOnce(MCAsmLayout &Layout) { } // Layout the section fragments and its size. - Layout.setSectionAddress(&SD, Address); - LayoutSection(SD, Layout); + LayoutSection(SD, Layout, Address); Address += Layout.getSectionFileSize(&SD); Prev = &SD; @@ -709,8 +710,7 @@ bool MCAssembler::LayoutOnce(MCAsmLayout &Layout) { if (uint64_t Pad = OffsetToAlignment(Address, it->getAlignment())) Address += Pad; - Layout.setSectionAddress(&SD, Address); - LayoutSection(SD, Layout); + LayoutSection(SD, Layout, Address); Address += Layout.getSectionSize(&SD); } |