aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2020-09-23 09:33:54 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-27 05:19:31 -0400
commitb3ad829bd17861251de97b58bb487978b14a0652 (patch)
treeae5ee24ac4b8032d2ae00f1fa59955d2411544d7 /gcc
parent0c1eba1a6a95b339b16cfceb2d10f8d05aea9fc4 (diff)
downloadgcc-b3ad829bd17861251de97b58bb487978b14a0652.zip
gcc-b3ad829bd17861251de97b58bb487978b14a0652.tar.gz
gcc-b3ad829bd17861251de97b58bb487978b14a0652.tar.bz2
[Ada] CUDA: handle parameter associations in expansion of CUDA_Execute
gcc/ada/ * exp_prag.adb (Append_Copies): Handle N_Parameter_Associations.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_prag.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index 14ccac9..53e2d97 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);