Parameter attributes on invoke calls were being lost due to the wrong

attribute index being used.  Fix proposed by Anton Korobeynikov, who
asked me to implement and commit it for him.  This is PR1398.

llvm-svn: 36906
This commit is contained in:
Duncan Sands 2007-05-07 20:49:28 +00:00
parent f84f319401
commit 20a9ed0e20

View File

@ -2787,10 +2787,12 @@ void SelectionDAGLowering::LowerCallTo(Instruction &I,
Value *Arg = I.getOperand(i);
SDOperand ArgNode = getValue(Arg);
Entry.Node = ArgNode; Entry.Ty = Arg->getType();
Entry.isSExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::SExt);
Entry.isZExt = Attrs && Attrs->paramHasAttr(i, ParamAttr::ZExt);
Entry.isInReg = Attrs && Attrs->paramHasAttr(i, ParamAttr::InReg);
Entry.isSRet = Attrs && Attrs->paramHasAttr(i, ParamAttr::StructRet);
unsigned attrInd = i - OpIdx + 1;
Entry.isSExt = Attrs && Attrs->paramHasAttr(attrInd, ParamAttr::SExt);
Entry.isZExt = Attrs && Attrs->paramHasAttr(attrInd, ParamAttr::ZExt);
Entry.isInReg = Attrs && Attrs->paramHasAttr(attrInd, ParamAttr::InReg);
Entry.isSRet = Attrs && Attrs->paramHasAttr(attrInd, ParamAttr::StructRet);
Args.push_back(Entry);
}