aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch7.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 15:24:04 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2009-11-30 15:24:04 +0100
commit90e9a6bef63cb79b87f6c7e58133f7e4cc9de52c (patch)
tree10d56ada1996a161049dab7dc4e5c8971e58a022 /gcc/ada/exp_ch7.adb
parent637da456be0b398ca1ffa7393514973e49f2f32d (diff)
downloadgcc-90e9a6bef63cb79b87f6c7e58133f7e4cc9de52c.zip
gcc-90e9a6bef63cb79b87f6c7e58133f7e4cc9de52c.tar.gz
gcc-90e9a6bef63cb79b87f6c7e58133f7e4cc9de52c.tar.bz2
[multiple changes]
2009-11-30 Javier Miranda <miranda@adacore.com> * exp_ch6.adb, sem_scil.adb (Adjust_SCIL_Node): Add missing management of N_Unchecked_Type_Conversion nodes when searching for SCIL nodes. (Expand_Call): Adjust decoration of SCIL node associated with relocated function call. 2009-11-30 Emmanuel Briot <briot@adacore.com> * prj-env.adb (Add_To_Source_Path): Preserve casing of directories 2009-11-30 Vincent Celier <celier@adacore.com> * opt.ads (No_Split_Units): New flag initialized to False 2009-11-30 Jerome Lambourg <lambourg@adacore.com> * exp_ch7.adb (Needs_Finalization): Add comments. * exp_ch3.adb (Make_Predefined_Primitive_Specs): Improve handling of CIL Value types. From-SVN: r154809
Diffstat (limited to 'gcc/ada/exp_ch7.adb')
-rw-r--r--gcc/ada/exp_ch7.adb27
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index db3cd20..880ae4e 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -3287,18 +3287,29 @@ package body Exp_Ch7 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.
+ return
+
+ -- Class-wide types must be treated as controlled and therefore
+ -- requiring finalization (because they may be extended with an
+ -- extension that has controlled components.
+
+ (Is_Class_Wide_Type (T)
+
+ -- However, avoid treating class-wide types as controlled if
+ -- finalization is not available and in particular CIL value
+ -- types never have finalization).
- -- We can skip this if finalization is not available.
- -- or if it is a value type (because ???)
+ and then not In_Finalization_Root (T)
+ and then not Restriction_Active (No_Finalization)
+ and then not Is_Value_Type (Etype (T)))
+
+ -- Controlled types always need finalization
- return (Is_Class_Wide_Type (T)
- and then not In_Finalization_Root (T)
- and then not Restriction_Active (No_Finalization)
- and then not Is_Value_Type (Etype (T)))
or else Is_Controlled (T)
or else Has_Some_Controlled_Component (T)
+
+ -- For concurrent types, test the corresponding record type
+
or else (Is_Concurrent_Type (T)
and then Present (Corresponding_Record_Type (T))
and then Needs_Finalization (Corresponding_Record_Type (T)));