aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2014-07-29 12:51:47 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 14:51:47 +0200
commitc5c780e6deb9cf337f4898db5716659698311d7d (patch)
treea24a16da19178913fb64eee87ace65e85b8ad461 /gcc/ada/exp_ch4.adb
parente2bc5465d67a558c23830e1561077eaba1f68973 (diff)
downloadgcc-c5c780e6deb9cf337f4898db5716659698311d7d.zip
gcc-c5c780e6deb9cf337f4898db5716659698311d7d.tar.gz
gcc-c5c780e6deb9cf337f4898db5716659698311d7d.tar.bz2
exp_ch4.adb (Process_Transient_Object): Remove constant In_Cond_Expr, use its initialization expression in place.
2014-07-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch4.adb (Process_Transient_Object): Remove constant In_Cond_Expr, use its initialization expression in place. * exp_ch7.adb (Process_Declarations): There is no need to check that a transient object being hooked is controlled as it would not have been hooked in the first place. * exp_util.adb (Is_Aliased): 'Reference-d or renamed transient objects are not considered aliased when the related context is a Boolean expression_with_actions. (Requires_Cleanup_Actions): There is no need to check that a transient object being hooked is controlled as it would not have been hooked in the first place. From-SVN: r213158
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb11
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 9abe25a..96aa7f1 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -12616,9 +12616,6 @@ package body Exp_Ch4 is
-- If False, call to finalizer includes a test of whether the hook
-- pointer is null.
- In_Cond_Expr : constant Boolean :=
- Within_Case_Or_If_Expression (Rel_Node);
-
begin
-- Step 0: determine where to attach finalization actions in the tree
@@ -12636,10 +12633,10 @@ package body Exp_Ch4 is
-- conditional expression.
Finalize_Always :=
- not (In_Cond_Expr
- or else
- Nkind_In (Original_Node (Rel_Node), N_Case_Expression,
- N_If_Expression));
+ not Within_Case_Or_If_Expression (Rel_Node)
+ and then not Nkind_In
+ (Original_Node (Rel_Node), N_Case_Expression,
+ N_If_Expression);
declare
Loc : constant Source_Ptr := Sloc (Rel_Node);