diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 10:40:53 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 10:40:53 +0200 |
commit | 25b589cbd523d5b7ccf42c7807f9cac86879008d (patch) | |
tree | e9a56ce2a97ee5439638449e07f387032b42b60d /gcc/ada/exp_util.adb | |
parent | 1197ddb11e3560bf1fb0f942746b85267948e094 (diff) | |
download | gcc-25b589cbd523d5b7ccf42c7807f9cac86879008d.zip gcc-25b589cbd523d5b7ccf42c7807f9cac86879008d.tar.gz gcc-25b589cbd523d5b7ccf42c7807f9cac86879008d.tar.bz2 |
[multiple changes]
2011-08-29 Hristian Kirtchev <kirtchev@adacore.com>
* exp_util.adb (Process_Statements_For_Controlled_Objects): Whenever a
statement list is wrapped in a block, the block is explicitly analyzed
in order to properly redecorate the entities and create a servicing
finalizer.
2011-08-29 Tristan Gingold <gingold@adacore.com>
* sinfo.ads, sinfo.adb (Zero_Cost_Handling): Remove.
(Set_Zero_Cost_Handling): Remove.
2011-08-29 Thomas Quinot <quinot@adacore.com>
* par_sco.adb, scos.ads, put_scos.adb, get_scos.adb: Minor reformatting
From-SVN: r178162
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r-- | gcc/ada/exp_util.adb | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index d4f8954..a5faf48 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -5483,9 +5483,17 @@ package body Exp_Util is Statements => L)); end Wrap_Statements_In_Block; + -- Local variables + + Block : Node_Id; + -- Start of processing for Process_Statements_For_Controlled_Objects begin + -- Whenever a non-handled statement list is wrapped in a block, the + -- block must be explicitly analyzed to redecorate all entities in the + -- list and ensure that a finalizer is properly built. + case Nkind (N) is when N_Elsif_Part | N_If_Statement | @@ -5500,8 +5508,10 @@ package body Exp_Util is and then Requires_Cleanup_Actions (Then_Statements (N), False, False) then - Set_Then_Statements (N, New_List ( - Wrap_Statements_In_Block (Then_Statements (N)))); + Block := Wrap_Statements_In_Block (Then_Statements (N)); + Set_Then_Statements (N, New_List (Block)); + + Analyze (Block); end if; -- Check the "else statements" for conditional entry calls, if @@ -5515,8 +5525,10 @@ package body Exp_Util is and then Requires_Cleanup_Actions (Else_Statements (N), False, False) then - Set_Else_Statements (N, New_List ( - Wrap_Statements_In_Block (Else_Statements (N)))); + Block := Wrap_Statements_In_Block (Else_Statements (N)); + Set_Else_Statements (N, New_List (Block)); + + Analyze (Block); end if; when N_Abortable_Part | @@ -5532,8 +5544,10 @@ package body Exp_Util is and then not Are_Wrapped (Statements (N)) and then Requires_Cleanup_Actions (Statements (N), False, False) then - Set_Statements (N, New_List ( - Wrap_Statements_In_Block (Statements (N)))); + Block := Wrap_Statements_In_Block (Statements (N)); + Set_Statements (N, New_List (Block)); + + Analyze (Block); end if; when others => |