propagate struct size and alignment of byval arguments to the DAG

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40986 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2007-08-10 14:44:42 +00:00
parent ae9671b838
commit 594d37e21a
6 changed files with 40 additions and 4 deletions
+11 -1
View File
@@ -28,6 +28,17 @@ CCState::CCState(unsigned CC, bool isVarArg, const TargetMachine &tm,
UsedRegs.resize(MRI.getNumRegs());
}
void CCState::HandleStruct(unsigned ValNo, MVT::ValueType ValVT,
MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
unsigned ArgFlags) {
unsigned Align = 1 << ((ArgFlags & ISD::ParamFlags::ByValAlign) >>
ISD::ParamFlags::ByValAlignOffs);
unsigned Size = (ArgFlags & ISD::ParamFlags::ByValSize) >>
ISD::ParamFlags::ByValSizeOffs;
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
}
/// MarkAllocated - Mark a register and all of its aliases as allocated.
void CCState::MarkAllocated(unsigned Reg) {
@@ -99,4 +110,3 @@ void CCState::AnalyzeCallResult(SDNode *TheCall, CCAssignFn Fn) {
}
}
}