byval's type parameter is now always required.
// If byval is used, this must be a pointer type, and the byval type must
// match the element type. Update it if present.
- if (ArgAttrs.getByValType()) {
- Type *NewTy = Callee->getParamByValType(ArgNo);
- ArgAttrs.addByValAttr(
- NewTy ? NewTy : cast<PointerType>(FormalTy)->getElementType());
- }
+ if (ArgAttrs.getByValType())
+ ArgAttrs.addByValAttr(Callee->getParamByValType(ArgNo));
NewArgAttrs.push_back(AttributeSet::get(Ctx, ArgAttrs));
AttributeChanged = true;