public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1690] [Ada] Add Return_Statement field
@ 2021-06-21 11:06 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-21 11:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d315f859f89dc925cc60c6df53a615b97be110e5

commit r12-1690-gd315f859f89dc925cc60c6df53a615b97be110e5
Author: Richard Kenner <kenner@adacore.com>
Date:   Thu Apr 1 11:35:07 2021 -0400

    [Ada] Add Return_Statement field
    
    gcc/ada/
    
            * einfo.ads (Return_Statement): Add documentation.
            * exp_ch6.adb (Expand_N_Extended_Return_Statement): Set it.
            * gen_il-fields.ads: Add it.
            * gen_il-gen-gen_entities.adb: Add it.

Diff:
---
 gcc/ada/einfo.ads                   | 5 +++++
 gcc/ada/exp_ch6.adb                 | 1 +
 gcc/ada/gen_il-fields.ads           | 1 +
 gcc/ada/gen_il-gen-gen_entities.adb | 2 ++
 4 files changed, 9 insertions(+)

diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 93ccffb699e..4c5a2daa2f7 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -4206,6 +4206,11 @@ package Einfo is
 --       entities (for convenience in setting it), but is only tested
 --       for the function case.
 
+--    Return_Statement
+--       Defined in E_Variable. Set when Is_Return_Object is set, in which
+--       case it points to the N_Simple_Return_Statement made from the
+--       extended return statement.
+
 --    Returns_By_Ref
 --       Defined in subprogram type entities and functions. Set if a function
 --       (or an access-to-function type) returns a result by reference, either
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 14c5d186eca..38d78b08ef2 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -6033,6 +6033,7 @@ package body Exp_Ch6 is
       --  Set the flag to prevent infinite recursion
 
       Set_Comes_From_Extended_Return_Statement (Return_Stmt);
+      Set_Return_Statement (Ret_Obj_Id, Return_Stmt);
 
       Rewrite (N, Result);
 
diff --git a/gcc/ada/gen_il-fields.ads b/gcc/ada/gen_il-fields.ads
index 768b116fc01..603f08a7d9f 100644
--- a/gcc/ada/gen_il-fields.ads
+++ b/gcc/ada/gen_il-fields.ads
@@ -874,6 +874,7 @@ package Gen_IL.Fields is
       Requires_Overriding,
       Return_Applies_To,
       Return_Present,
+      Return_Statement,
       Returns_By_Ref,
       Reverse_Bit_Order,
       Reverse_Storage_Order,
diff --git a/gcc/ada/gen_il-gen-gen_entities.adb b/gcc/ada/gen_il-gen-gen_entities.adb
index dda309bec10..9fe9012abb5 100644
--- a/gcc/ada/gen_il-gen-gen_entities.adb
+++ b/gcc/ada/gen_il-gen-gen_entities.adb
@@ -350,6 +350,7 @@ begin -- Gen_IL.Gen.Gen_Entities
         Sm (Prival_Link, Node_Id),
         Sm (Related_Expression, Node_Id),
         Sm (Related_Type, Node_Id),
+        Sm (Return_Statement, Node_Id),
         Sm (Size_Check_Code, Node_Id),
         Sm (SPARK_Pragma, Node_Id),
         Sm (SPARK_Pragma_Inherited, Flag),
@@ -421,6 +422,7 @@ begin -- Gen_IL.Gen.Gen_Entities
         Sm (Prival_Link, Node_Id),
         Sm (Related_Expression, Node_Id),
         Sm (Related_Type, Node_Id),
+        Sm (Return_Statement, Node_Id),
         Sm (Shared_Var_Procs_Instance, Node_Id),
         Sm (Size_Check_Code, Node_Id),
         Sm (SPARK_Pragma, Node_Id),


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-21 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 11:06 [gcc r12-1690] [Ada] Add Return_Statement field Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).