aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-11-09 15:00:56 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-11-28 10:35:48 +0100
commit39cb85867dee738bd3773b63c2b48d5d0731dea5 (patch)
tree1b82a51f2afb76185059e67a2759e6ffe9f1cc13 /gcc/ada/gcc-interface/decl.cc
parent1954686718b97f927061a2840326734f0449adeb (diff)
downloadgcc-39cb85867dee738bd3773b63c2b48d5d0731dea5.zip
gcc-39cb85867dee738bd3773b63c2b48d5d0731dea5.tar.gz
gcc-39cb85867dee738bd3773b63c2b48d5d0731dea5.tar.bz2
ada: Further cleanup in finalization machinery
When transient scopes are being materialized, they can give rise to a block created around the construct being wrapped or not, depending on the kind of construct. In both cases finalization actions for the transient objects of the scope are generated the same way, with normal finalization done manually immediately after the construct and exceptional finalization deferred to the enclosing scope by means of a hooking mechanism. Now when the block is generated, it becomes this enclosing scope, so the normal finalization that comes with it would also be done immediately after the construct, even without normal finalization generated manually. Therefore this change gets rid of the manual finalization as well as of the hooking in the cases where the block is generated, leading to a significant streamlining of the expanded code in these cases. This requires fixing a small inaccuracy of the Within_Case_Or_If_Expression predicate, which must only be concerned with the dependent expressions, since those are the only ones to be treated specially by the finalization machinery. It also contains a small cleanup for the description of the transient scope management present at the beginning of the exp_ch7.adb file. gcc/ada/ * exp_ch7.ads (Expand_Cleanup_Actions): Move declaration to the Finalization Management section. * exp_ch7.adb (Transient Scope Management): Move description down to after that of the general finalization and make a few changes. (Insert_Actions_In_Scope_Around): Call Process_Transients_In_Scope only if cleanups are being handled. (Process_Transients_In_Scope): Remove redundant test on Clean. * exp_util.ads (Within_Case_Or_If_Expression): Adjust description. * exp_util.adb (Within_Case_Or_If_Expression): Only return true if within the dependent expressions of the conditional expressions.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
0 files changed, 0 insertions, 0 deletions