mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
ByVal stack slot alignment should be at least as large as pointer ABI alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45995 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5daafa9b1b
commit
c67e6e8e82
@ -15,6 +15,7 @@
|
||||
#include "llvm/CodeGen/CallingConvLower.h"
|
||||
#include "llvm/CodeGen/SelectionDAGNodes.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
using namespace llvm;
|
||||
|
||||
@ -31,11 +32,12 @@ CCState::CCState(unsigned CC, bool isVarArg, const TargetMachine &tm,
|
||||
void CCState::HandleStruct(unsigned ValNo, MVT::ValueType ValVT,
|
||||
MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
|
||||
unsigned ArgFlags) {
|
||||
unsigned MinAlign = TM.getTargetData()->getPointerABIAlignment();
|
||||
unsigned Align = 1 << ((ArgFlags & ISD::ParamFlags::ByValAlign) >>
|
||||
ISD::ParamFlags::ByValAlignOffs);
|
||||
unsigned Size = (ArgFlags & ISD::ParamFlags::ByValSize) >>
|
||||
ISD::ParamFlags::ByValSizeOffs;
|
||||
unsigned Offset = AllocateStack(Size, Align);
|
||||
unsigned Offset = AllocateStack(Size, std::max(MinAlign, Align));
|
||||
|
||||
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user