summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-18 09:41:49 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-18 09:41:49 +0000
commite977c0cf76179b3df7859a44eb3684f2b8ba1d84 (patch)
tree6345fad875d9b717d4e71879be479d45f16114aa /gcc/ada/exp_util.adb
parentc9e3ee199ab6b3aa3f86db68f0729680235dbc62 (diff)
downloadgcc-e977c0cf76179b3df7859a44eb3684f2b8ba1d84.tar.gz
2010-06-18 Robert Dewar <dewar@adacore.com>
* checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case expression (cannot count on a particular branch being executed). * exp_ch4.adb (Expand_N_Case_Expression): New procedure. * exp_ch4.ads (Expand_N_Case_Expression): New procedure. * exp_util.adb (Insert_Actions): Deal with proper insertion of actions within case expression. * expander.adb (Expand): Add call to Expand_N_Case_Expression * par-ch4.adb Add calls to P_Case_Expression at appropriate points (P_Case_Expression): New procedure (P_Case_Expression_Alternative): New procedure * par.adb (P_Case_Expression): New procedure * par_sco.adb (Process_Decisions): Add dummy place holder entry for N_Case_Expression. * sem.adb (Analyze): Add call to Analyze_Case_Expression * sem_case.ads (Analyze_Choices): Also used for case expressions now, this is a documentation change only. * sem_ch4.ads, sem_ch4.adb (Analyze_Case_Expression): New procedure. * sem_ch6.adb (Fully_Conformant_Expressions): Add handling of case expressions. * sem_eval.ads, sem_eval.adb (Eval_Case_Expression): New procedure. * sem_res.adb (Resolve_Case_Expression): New procedure. * sem_scil.adb (Find_SCIL_Node): Add processing for N_Case_Expression_Alternative. * sinfo.ads, sinfo.adb (N_Case_Expression): New node. (N_Case_Expression_Alternative): New node. * sprint.adb (Sprint_Node_Actual): Add processing for new nodes N_Case_Expression and N_Case_Expression_Alternative. 2010-06-18 Robert Dewar <dewar@adacore.com> * par-ch7.adb, sem_warn.adb, types.ads, par-ch3.adb: Minor reformatting. * gnat1drv.adb: Fix typo. 2010-06-18 Robert Dewar <dewar@adacore.com> * par-prag.adb (Prag, case Style_Checks): All_Checks sets gnat style for -gnatg. * sem_prag.adb (Analyze_Pragma, case Style_Checks): All_Checks sets gnat style for -gnatg. * gnat_rm.texi: Add documentation for ALL_CHECKS in GNAT mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160971 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r--gcc/ada/exp_util.adb16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 4f2e7f7399d..e8a85103be8 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -2417,6 +2417,21 @@ package body Exp_Util is
end if;
end;
+ -- Alternative of case expression, we place the action in
+ -- the Actions field of the case expression alternative, this
+ -- will be handled when the case expression is expanded.
+
+ when N_Case_Expression_Alternative =>
+ if Present (Actions (P)) then
+ Insert_List_After_And_Analyze
+ (Last (Actions (P)), Ins_Actions);
+ else
+ Set_Actions (P, Ins_Actions);
+ Analyze_List (Then_Actions (P));
+ end if;
+
+ return;
+
-- Case of appearing within an Expressions_With_Actions node. We
-- prepend the actions to the list of actions already there.
@@ -2679,6 +2694,7 @@ package body Exp_Util is
N_Access_To_Object_Definition |
N_Aggregate |
N_Allocator |
+ N_Case_Expression |
N_Case_Statement_Alternative |
N_Character_Literal |
N_Compilation_Unit |