+ if (RAttrs)
+ ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, RAttrs));
+
+ // Construct the new parameter list from non-dead arguments. Also construct
+ // a new set of parameter attributes to correspond.
+ unsigned index = 1;
+ for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
+ ++I, ++index)
+ if (!DeadArguments.count(I)) {
+ Params.push_back(I->getType());
+
+ if (ParameterAttributes Attrs = PAL.getParamAttrs(index))
+ ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), Attrs));
+ }
+
+ // Reconstruct the ParamAttrsList based on the vector we constructed.
+ PAListPtr NewPAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
+