diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-27 17:39:57 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-01-27 17:39:57 +0100 |
commit | 8fdafe44be001fa59172d7a28626d4babdc24b7b (patch) | |
tree | 691222cccf636cf338d10501185fedb34354d5fb /gcc/ada/exp_smem.adb | |
parent | b3a699930b7b61d37753e8714929cd2d9c1fb6d8 (diff) | |
download | gcc-8fdafe44be001fa59172d7a28626d4babdc24b7b.zip gcc-8fdafe44be001fa59172d7a28626d4babdc24b7b.tar.gz gcc-8fdafe44be001fa59172d7a28626d4babdc24b7b.tar.bz2 |
[multiple changes]
2014-01-27 Thomas Quinot <quinot@adacore.com>
* exp_ch7.adb: Minor reformatting.
2014-01-27 Robert Dewar <dewar@adacore.com>
* opt.adb (SPARK_Mode): Default for library units is None rather
than Off.
* opt.ads: Remove AUTO from SPARK_Mode_Type SPARK_Mode_Type is
no longer ordered.
* sem_prag.adb (Analyze_Pragma, case SPARK_Mode): Remove AUTO
possibility.
* snames.ads-tmpl (Name_Auto): Removed, no longer used.
2014-01-27 Robert Dewar <dewar@adacore.com>
* par-ch5.adb (P_Sequence_Of_Statements): Make entry in
Suspicious_Labels table if we have identifier; followed by loop
or block.
* par-endh.adb (Evaluate_End_Entry): Search Suspicious_Labels table.
* par.adb (Suspicious_Labels): New table.
2014-01-27 Robert Dewar <dewar@adacore.com>
* exp_aggr.adb (Check_Bounds): Reason is range check, not
length check.
2014-01-27 Yannick Moy <moy@adacore.com>
* get_spark_xrefs.adb (Get_SPARK_Xrefs): Accept new type 'c' for
reference.
* lib-xref-spark_specific.adb (Is_Global_Constant): Remove useless
function now.
(Add_SPARK_Xrefs): Include references to constants.
* spark_xrefs.ads Document new character 'c' for references to
constants.
2014-01-27 Thomas Quinot <quinot@adacore.com>
* exp_smem.adb (Add_Write_After): For a function call, insert write as
an after action in a transient scope.
From-SVN: r207140
Diffstat (limited to 'gcc/ada/exp_smem.adb')
-rw-r--r-- | gcc/ada/exp_smem.adb | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ada/exp_smem.adb b/gcc/ada/exp_smem.adb index 2b83105..7fb40c4 100644 --- a/gcc/ada/exp_smem.adb +++ b/gcc/ada/exp_smem.adb @@ -25,6 +25,7 @@ with Atree; use Atree; with Einfo; use Einfo; +with Exp_Ch7; use Exp_Ch7; with Exp_Ch9; use Exp_Ch9; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; @@ -58,8 +59,10 @@ package body Exp_Smem is procedure Add_Write_After (N : Node_Id); -- Insert a Shared_Var_WOpen call for variable after the node Insert_Node, -- as recorded by On_Lhs_Of_Assignment (where it points to the assignment - -- statement) or Is_Out_Actual (where it points to the procedure call - -- statement). + -- statement) or Is_Out_Actual (where it points to the subprogram call). + -- When Insert_Node is a function call, establish a transient scope around + -- the expression, and insert the write as an after-action of the transient + -- scope. procedure Build_Full_Name (E : Entity_Id; N : out String_Id); -- Build the fully qualified string name of a shared variable @@ -191,12 +194,18 @@ package body Exp_Smem is procedure Add_Write_After (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); - Ent : constant Node_Id := Entity (N); - + Ent : constant Entity_Id := Entity (N); + Par : constant Node_Id := Insert_Node; begin if Present (Shared_Var_Procs_Instance (Ent)) then - Insert_After_And_Analyze (Insert_Node, - Build_Shared_Var_Proc_Call (Loc, Ent, Name_Write)); + if Nkind (Insert_Node) = N_Function_Call then + Establish_Transient_Scope (Insert_Node, Sec_Stack => False); + Store_After_Actions_In_Scope (New_List ( + Build_Shared_Var_Proc_Call (Loc, Ent, Name_Write))); + else + Insert_After_And_Analyze (Par, + Build_Shared_Var_Proc_Call (Loc, Ent, Name_Write)); + end if; end if; end Add_Write_After; |