mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Remove the assumption that byval has been applied to
a pointer to a struct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
421d1c93cc
commit
a41d719803
@ -3916,12 +3916,12 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
|
||||
if (F.paramHasAttr(j, ParamAttr::ByVal)) {
|
||||
Flags |= ISD::ParamFlags::ByVal;
|
||||
const PointerType *Ty = cast<PointerType>(I->getType());
|
||||
const StructType *STy = cast<StructType>(Ty->getElementType());
|
||||
unsigned StructAlign =
|
||||
Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
|
||||
unsigned StructSize = getTargetData()->getABITypeSize(STy);
|
||||
Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
|
||||
Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);
|
||||
const Type *ElementTy = Ty->getElementType();
|
||||
unsigned FrameAlign =
|
||||
Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
|
||||
unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
|
||||
Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
|
||||
Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs);
|
||||
}
|
||||
if (F.paramHasAttr(j, ParamAttr::Nest))
|
||||
Flags |= ISD::ParamFlags::Nest;
|
||||
@ -4046,12 +4046,12 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
|
||||
if (Args[i].isByVal) {
|
||||
Flags |= ISD::ParamFlags::ByVal;
|
||||
const PointerType *Ty = cast<PointerType>(Args[i].Ty);
|
||||
const StructType *STy = cast<StructType>(Ty->getElementType());
|
||||
unsigned StructAlign =
|
||||
Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
|
||||
unsigned StructSize = getTargetData()->getABITypeSize(STy);
|
||||
Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
|
||||
Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);
|
||||
const Type *ElementTy = Ty->getElementType();
|
||||
unsigned FrameAlign =
|
||||
Log2_32(getTargetData()->getCallFrameTypeAlignment(ElementTy));
|
||||
unsigned FrameSize = getTargetData()->getABITypeSize(ElementTy);
|
||||
Flags |= (FrameAlign << ISD::ParamFlags::ByValAlignOffs);
|
||||
Flags |= (FrameSize << ISD::ParamFlags::ByValSizeOffs);
|
||||
}
|
||||
if (Args[i].isNest)
|
||||
Flags |= ISD::ParamFlags::Nest;
|
||||
|
Loading…
Reference in New Issue
Block a user