Oops. Forgot to commit this.

llvm-svn: 46002
This commit is contained in:
Evan Cheng 2008-01-15 07:49:36 +00:00
parent 6bbbc4cbfa
commit eb30bb7d29
1 changed files with 12 additions and 5 deletions

View File

@ -29,15 +29,22 @@ 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 MinAlign = TM.getTargetData()->getPointerABIAlignment();
// HandleByVal - Allocate a stack slot large enough to pass an argument by
// value. The size and alignment information of the argument is encoded in its
// parameter attribute.
void CCState::HandleByVal(unsigned ValNo, MVT::ValueType ValVT,
MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
int MinSize, int MinAlign,
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, std::max(MinAlign, Align));
if (MinSize > (int)Size)
Size = MinSize;
if (MinAlign > (int)Align)
Align = MinAlign;
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
}