diff --git a/llvm/include/llvm/CodeGen/CallingConvLower.h b/llvm/include/llvm/CodeGen/CallingConvLower.h --- a/llvm/include/llvm/CodeGen/CallingConvLower.h +++ b/llvm/include/llvm/CodeGen/CallingConvLower.h @@ -424,16 +424,20 @@ /// AllocateStack - Allocate a chunk of stack space with the specified size /// and alignment. - unsigned AllocateStack(unsigned Size, unsigned Alignment) { - const Align CheckedAlignment(Alignment); - StackOffset = alignTo(StackOffset, CheckedAlignment); + unsigned AllocateStack(unsigned Size, Align Alignment) { + StackOffset = alignTo(StackOffset, Alignment); unsigned Result = StackOffset; StackOffset += Size; - MaxStackArgAlign = std::max(CheckedAlignment, MaxStackArgAlign); - ensureMaxAlignment(CheckedAlignment); + MaxStackArgAlign = std::max(Alignment, MaxStackArgAlign); + ensureMaxAlignment(Alignment); return Result; } + // FIXME: Deprecate this function when transition to Align is over. + unsigned AllocateStack(unsigned Size, unsigned Alignment) { + return AllocateStack(Size, Align(Alignment)); + } + void ensureMaxAlignment(Align Alignment) { if (!AnalyzingMustTailForwardedRegs) MF.getFrameInfo().ensureMaxAlignment(Alignment); diff --git a/llvm/utils/TableGen/CallingConvEmitter.cpp b/llvm/utils/TableGen/CallingConvEmitter.cpp --- a/llvm/utils/TableGen/CallingConvEmitter.cpp +++ b/llvm/utils/TableGen/CallingConvEmitter.cpp @@ -197,7 +197,7 @@ "getTypeAllocSize(EVT(LocVT).getTypeForEVT(State.getContext()))," " "; if (Align) - O << Align; + O << "Align(" << Align << ")"; else O << "\n" << IndentStr << " State.getMachineFunction().getDataLayout()."