aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-05-24 10:01:13 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-07-06 13:29:49 +0000
commit940bbc4363b4cee9682a96e17fbb536f61c50c21 (patch)
tree491e556f99681cc567706e57c83587ba632abffe /gcc/ada/gcc-interface/decl.cc
parent889db59e6e77abf5253c8355d6a5ccbdfe42d3ec (diff)
downloadgcc-940bbc4363b4cee9682a96e17fbb536f61c50c21.zip
gcc-940bbc4363b4cee9682a96e17fbb536f61c50c21.tar.gz
gcc-940bbc4363b4cee9682a96e17fbb536f61c50c21.tar.bz2
[Ada] Small tweak to gnat_to_gnu_subprog_type
No functional changes. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Constify a local variable and move a couple of others around.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
-rw-r--r--gcc/ada/gcc-interface/decl.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 6e22feb..e7e5ad5 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -5777,10 +5777,9 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
bool debug_info_p, tree *param_list)
{
const Entity_Kind kind = Ekind (gnat_subprog);
+ const Entity_Id gnat_return_type = Etype (gnat_subprog);
const bool method_p = is_cplusplus_method (gnat_subprog);
const bool variadic = IN (Convention (gnat_subprog), Convention_C_Variadic);
- Entity_Id gnat_return_type = Etype (gnat_subprog);
- Entity_Id gnat_param;
tree gnu_type = present_gnu_tree (gnat_subprog)
? TREE_TYPE (get_gnu_tree (gnat_subprog)) : NULL_TREE;
tree gnu_return_type;
@@ -5810,7 +5809,6 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
bool return_by_direct_ref_p = false;
bool return_by_invisi_ref_p = false;
bool incomplete_profile_p = false;
- int num;
/* Look into the return type and get its associated GCC tree if it is not
void, and then compute various flags for the subprogram type. But make
@@ -5944,6 +5942,8 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool definition,
/* Loop over the parameters and get their associated GCC tree. While doing
this, build a copy-in copy-out structure if we need one. */
+ Entity_Id gnat_param;
+ int num;
for (gnat_param = First_Formal_With_Extras (gnat_subprog), num = 0;
Present (gnat_param);
gnat_param = Next_Formal_With_Extras (gnat_param), num++)