diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-27 13:26:16 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-05-27 13:26:16 +0000 |
commit | c96806b27127d7424dd51580c9167df302fb60b4 (patch) | |
tree | 245c403c097854f6ab68fac514ca38cc0bb4830e /gcc/ada/exp_prag.adb | |
parent | a95e57762d0418d031feae89c90762758500c36e (diff) | |
download | gcc-c96806b27127d7424dd51580c9167df302fb60b4.tar.gz |
2015-05-27 Robert Dewar <dewar@adacore.com>
* sem_aux.adb: Minor rewording.
2015-05-27 Bob Duff <duff@adacore.com>
* exp_prag.adb (Expand_Pragma_Abort_Defer): Make
pragma Abort_Defer do nothing if Abort_Allowed is False.
2015-05-27 Arnaud Charlet <charlet@adacore.com>
* exp_ch9.adb, sem_util.adb, sem_util.ads, s-stposu.adb, s-spsufi.ads,
sem_elab.ads, g-comlin.ads, errout.ads, exp_ch6.adb, sem_ch4.adb,
opt.ads, s-bignum.adb, output.ads, sem_ch13.adb, erroutc.ads,
sem_disp.ads, exp_ch3.adb: Minor fixes of duplicate words in comments.
2015-05-27 Doug Rupp <rupp@adacore.com>
* adaint.c (__gnat_tmp_name) [vxworks]: Robustify and use for rtp as
well as kernel.
2015-05-27 Pierre-Marie de Rodat <derodat@adacore.com>
* par_sco.adb (Process_Decision): Store sloc to
condition/pragmas SCOs associations into a temporary table before
moving them to the SCO_Raw_Hash_Table so that we can back them
out just like we do for SCO entries that are simple decisions
in an expression context.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223754 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_prag.adb')
-rw-r--r-- | gcc/ada/exp_prag.adb | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb index d47e31c7cec..a797f230bbf 100644 --- a/gcc/ada/exp_prag.adb +++ b/gcc/ada/exp_prag.adb @@ -251,41 +251,51 @@ package body Exp_Prag is -- end; procedure Expand_Pragma_Abort_Defer (N : Node_Id) is - Loc : constant Source_Ptr := Sloc (N); - Stm : Node_Id; - Stms : List_Id; - HSS : Node_Id; - Blk : constant Entity_Id := - New_Internal_Entity (E_Block, Current_Scope, Sloc (N), 'B'); - AUD : constant Entity_Id := RTE (RE_Abort_Undefer_Direct); - begin - Stms := New_List (Build_Runtime_Call (Loc, RE_Abort_Defer)); - loop - Stm := Remove_Next (N); - exit when No (Stm); - Append (Stm, Stms); - end loop; + -- Abort_Defer has no useful effect if Abort's are not allowed + + if not Abort_Allowed then + return; + end if; + + -- Normal case where abort is possible - HSS := - Make_Handled_Sequence_Of_Statements (Loc, - Statements => Stms, - At_End_Proc => New_Occurrence_Of (AUD, Loc)); + declare + Loc : constant Source_Ptr := Sloc (N); + Stm : Node_Id; + Stms : List_Id; + HSS : Node_Id; + Blk : constant Entity_Id := + New_Internal_Entity (E_Block, Current_Scope, Sloc (N), 'B'); + AUD : constant Entity_Id := RTE (RE_Abort_Undefer_Direct); - -- Present the Abort_Undefer_Direct function to the backend so that it - -- can inline the call to the function. + begin + Stms := New_List (Build_Runtime_Call (Loc, RE_Abort_Defer)); + loop + Stm := Remove_Next (N); + exit when No (Stm); + Append (Stm, Stms); + end loop; - Add_Inlined_Body (AUD, N); + HSS := + Make_Handled_Sequence_Of_Statements (Loc, + Statements => Stms, + At_End_Proc => New_Occurrence_Of (AUD, Loc)); - Rewrite (N, - Make_Block_Statement (Loc, - Handled_Statement_Sequence => HSS)); + -- Present the Abort_Undefer_Direct function to the backend so that + -- it can inline the call to the function. - Set_Scope (Blk, Current_Scope); - Set_Etype (Blk, Standard_Void_Type); - Set_Identifier (N, New_Occurrence_Of (Blk, Sloc (N))); - Expand_At_End_Handler (HSS, Blk); - Analyze (N); + Add_Inlined_Body (AUD, N); + + Rewrite (N, + Make_Block_Statement (Loc, Handled_Statement_Sequence => HSS)); + + Set_Scope (Blk, Current_Scope); + Set_Etype (Blk, Standard_Void_Type); + Set_Identifier (N, New_Occurrence_Of (Blk, Sloc (N))); + Expand_At_End_Handler (HSS, Blk); + Analyze (N); + end; end Expand_Pragma_Abort_Defer; -------------------------- |