[CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.
[oota-llvm.git] / lib / Target / ARM / ARMFrameLowering.cpp
index 68f938533cfe3bb03a26b82a4b220c7b9eb5057a..b52ca93c20452afdadae4b0b638d45f0a2b252fb 100644 (file)
@@ -1734,8 +1734,7 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
       // We need to keep the stack aligned properly.  To do this, we round the
       // amount of space needed for the outgoing arguments up to the next
       // alignment boundary.
-      unsigned Align = getStackAlignment();
-      Amount = (Amount+Align-1)/Align*Align;
+      Amount = alignSPAdjust(Amount);
 
       ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
       assert(!AFI->isThumb1OnlyFunction() &&
@@ -1886,11 +1885,9 @@ void ARMFrameLowering::adjustForSegmentedStacks(
   for (int Idx = 0; Idx < NbAddedBlocks; ++Idx)
     BeforePrologueRegion.insert(AddedBlocks[Idx]);
 
-  for (MachineBasicBlock::livein_iterator i = PrologueMBB.livein_begin(),
-                                          e = PrologueMBB.livein_end();
-       i != e; ++i) {
+  for (const auto &LI : PrologueMBB.liveins()) {
     for (MachineBasicBlock *PredBB : BeforePrologueRegion)
-      PredBB->addLiveIn(*i);
+      PredBB->addLiveIn(LI);
   }
 
   // Remove the newly added blocks from the list, since we know