aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2018-05-22 13:25:22 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-05-22 13:25:22 +0000
commit801b4022e11b50c4124b489ccc621332b2d92946 (patch)
tree4f2c12ed748b28bddeeadaefb7cccf0baafd8660 /gcc/ada/sem_ch4.adb
parent208ebca928f079408cea3562a0006bc1bb8092fa (diff)
downloadgcc-801b4022e11b50c4124b489ccc621332b2d92946.zip
gcc-801b4022e11b50c4124b489ccc621332b2d92946.tar.gz
gcc-801b4022e11b50c4124b489ccc621332b2d92946.tar.bz2
[Ada] Ada2020: Reduction expressions
This patch dismantles the prototype implementation of the first proposal for Reduction expressions, one of the important potentially parallel constructs for Ada2020. The ARG is going in a different direction with a simpler syntax. 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention of N_Reduction_Expression and N_Reduction_Expression_Parameter. * par-ch4.adb: Remove parsing routines for reduction expressions. * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb, sem_spark.adb, sprint.adb: Remove analysis routines for reduction expressions. From-SVN: r260524
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb77
1 files changed, 0 insertions, 77 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 0d77ad1..5d2e81b 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4365,83 +4365,6 @@ package body Sem_Ch4 is
Check_Function_Writable_Actuals (N);
end Analyze_Range;
- -----------------------------------
- -- Analyze_Reduction_Expression --
- -----------------------------------
-
- procedure Analyze_Reduction_Expression (N : Node_Id) is
- Expr : constant Node_Id := Expression (N);
- QE_Scop : Entity_Id;
-
- begin
- -- The processing is similar to that for quantified expressions,
- -- which have a similar structure and are eventually transformed
- -- into a loop.
-
- QE_Scop := New_Internal_Entity (E_Loop, Current_Scope, Sloc (N), 'L');
- Set_Etype (QE_Scop, Standard_Void_Type);
- Set_Scope (QE_Scop, Current_Scope);
- Set_Parent (QE_Scop, N);
-
- Push_Scope (QE_Scop);
-
- -- All constituents are preanalyzed and resolved to avoid untimely
- -- generation of various temporaries and types. Full analysis and
- -- expansion is carried out when the reduction expression is
- -- transformed into an expression with actions.
-
- if Present (Iterator_Specification (N)) then
- Preanalyze (Iterator_Specification (N));
-
- else pragma Assert (Present (Loop_Parameter_Specification (N)));
- declare
- Loop_Par : constant Node_Id := Loop_Parameter_Specification (N);
-
- begin
- Preanalyze (Loop_Par);
-
- if Nkind (Discrete_Subtype_Definition (Loop_Par)) = N_Function_Call
- and then Parent (Loop_Par) /= N
- then
- -- The parser cannot distinguish between a loop specification
- -- and an iterator specification. If after preanalysis the
- -- proper form has been recognized, rewrite the expression to
- -- reflect the right kind. This is needed for proper ASIS
- -- navigation. If expansion is enabled, the transformation is
- -- performed when the expression is rewritten as a loop.
-
- Set_Iterator_Specification (N,
- New_Copy_Tree (Iterator_Specification (Parent (Loop_Par))));
-
- Set_Defining_Identifier (Iterator_Specification (N),
- Relocate_Node (Defining_Identifier (Loop_Par)));
- Set_Name (Iterator_Specification (N),
- Relocate_Node (Discrete_Subtype_Definition (Loop_Par)));
- Set_Comes_From_Source (Iterator_Specification (N),
- Comes_From_Source (Loop_Parameter_Specification (N)));
- Set_Loop_Parameter_Specification (N, Empty);
- end if;
- end;
- end if;
-
- Preanalyze (Expr);
- End_Scope;
-
- Set_Etype (N, Etype (Expr));
- end Analyze_Reduction_Expression;
-
- --------------------------------------------
- -- Analyze_Reduction_Expression_Parameter --
- --------------------------------------------
-
- procedure Analyze_Reduction_Expression_Parameter (N : Node_Id) is
- Expr : constant Node_Id := Expression (N);
-
- begin
- Analyze (Expr);
- Set_Etype (N, Etype (Expr));
- end Analyze_Reduction_Expression_Parameter;
-
-----------------------
-- Analyze_Reference --
-----------------------