File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -590,15 +590,19 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
590
590
ParamAttrsVec.push_back (ParamAttrsWithIndex::get (Args.size (), Attrs));
591
591
}
592
592
593
- // Reconstruct the ParamAttrsList based on the vector we constructed.
594
- PAL = ParamAttrsList::get (ParamAttrsVec);
595
-
596
593
if (ExtraArgHack)
597
594
Args.push_back (UndefValue::get (Type::Int32Ty));
598
595
599
- // Push any varargs arguments on the list
600
- for (; AI != CS.arg_end (); ++AI)
596
+ // Push any varargs arguments on the list. Don't forget their attributes.
597
+ for (; AI != CS.arg_end (); ++AI) {
601
598
Args.push_back (*AI);
599
+ uint16_t Attrs = PAL ? PAL->getParamAttrs (index++) : 0 ;
600
+ if (Attrs)
601
+ ParamAttrsVec.push_back (ParamAttrsWithIndex::get (Args.size (), Attrs));
602
+ }
603
+
604
+ // Reconstruct the ParamAttrsList based on the vector we constructed.
605
+ PAL = ParamAttrsList::get (ParamAttrsVec);
602
606
603
607
Instruction *New;
604
608
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
You can’t perform that action at this time.
0 commit comments