From: Ghjuvan Lacambre Date: Wed, 23 Sep 2020 07:33:54 +0000 (+0200) Subject: [Ada] CUDA: handle parameter associations in expansion of CUDA_Execute X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3ad829bd17861251de97b58bb487978b14a0652;p=gcc.git [Ada] CUDA: handle parameter associations in expansion of CUDA_Execute gcc/ada/ * exp_prag.adb (Append_Copies): Handle N_Parameter_Associations. --- diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index 14ccac9b2a4..53e2d97cd75 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -778,16 +778,23 @@ package body Exp_Prag is is Copy : Entity_Id; Param : Node_Id; + Expr : Node_Id; begin Param := First (Params); while Present (Param) loop Copy := Make_Temporary (Loc, 'C'); + if Nkind (Param) = N_Parameter_Association then + Expr := Explicit_Actual_Parameter (Param); + else + Expr := Param; + end if; + Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Copy, - Object_Definition => New_Occurrence_Of (Etype (Param), Loc), - Expression => New_Copy_Tree (Param))); + Object_Definition => New_Occurrence_Of (Etype (Expr), Loc), + Expression => New_Copy_Tree (Expr))); Append_Elmt (Copy, Copies); Next (Param);