aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_util.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:49:52 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-03 16:49:52 +0200
commitf553e7bc12de8a7d47f51cc5ea0c3d2a22de487e (patch)
tree59d55631d2c1913cb618b2b073968fcf83a2a2fc /gcc/ada/exp_util.adb
parent78277376769b518b84f67ccc852af06d1842bad3 (diff)
downloadgcc-f553e7bc12de8a7d47f51cc5ea0c3d2a22de487e.zip
gcc-f553e7bc12de8a7d47f51cc5ea0c3d2a22de487e.tar.gz
gcc-f553e7bc12de8a7d47f51cc5ea0c3d2a22de487e.tar.bz2
[multiple changes]
2011-08-03 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch13.adb: Add with and use clauses for Restrict and Rident. (Expand_N_Free_Statement): Add a guard to protect against run-times which do not support controlled types. * exp_ch3.adb (Expand_Freeze_Class_Wide_Type): Add a guard to protect against run-times which do not support controlled types. * exp_ch4.adb (Complete_Controlled_Allocation): Add a guard to protect against run-times which do not support controlled types. * exp_ch7.adb (Build_Finalization_Collection): Add a guard to protect against run-times which do not support controlled types. * exp_util.adb (Needs_Finalization): Code reformatting. Add a guard to protect against run-times which do not support controlled types. 2011-08-03 Eric Botcazou <ebotcazou@adacore.com> * exp_intr.adb: Put back with and use clauses for Exp_Ch11. (Expand_Unc_Deallocation): Expand the AT_END handler at the very end. From-SVN: r177280
Diffstat (limited to 'gcc/ada/exp_util.adb')
-rw-r--r--gcc/ada/exp_util.adb25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 9388e66..5775103 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -5367,19 +5367,26 @@ package body Exp_Util is
-- Start of processing for Needs_Finalization
begin
- -- Class-wide types must be treated as controlled because they may
- -- contain an extension that has controlled components
+ -- Certain run-time configurations and targets do not provide support
+ -- for controlled types.
- -- We can skip this if finalization is not available
+ if Restriction_Active (No_Finalization) then
+ return False;
- return (Is_Class_Wide_Type (T)
- and then not Restriction_Active (No_Finalization))
- or else Is_Controlled (T)
- or else Has_Controlled_Component (T)
- or else Has_Some_Controlled_Component (T)
- or else (Is_Concurrent_Type (T)
+ else
+ -- Class-wide types are treated as controlled because derivations
+ -- from the root type can introduce controlled components.
+
+ return
+ Is_Class_Wide_Type (T)
+ or else Is_Controlled (T)
+ or else Has_Controlled_Component (T)
+ or else Has_Some_Controlled_Component (T)
+ or else
+ (Is_Concurrent_Type (T)
and then Present (Corresponding_Record_Type (T))
and then Needs_Finalization (Corresponding_Record_Type (T)));
+ end if;
end Needs_Finalization;
----------------------------