MC: Sink Section address assignment into LayoutSection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99528 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 5190239..c0ec04d 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -365,9 +365,11 @@
 }
 
 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 @@
     }
 
     // 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 @@
     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);
   }