From: Arnaud Charlet Date: Mon, 30 Nov 2009 14:24:04 +0000 (+0100) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.5.0~1914 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90e9a6bef63cb79b87f6c7e58133f7e4cc9de52c;p=thirdparty%2Fgcc.git [multiple changes] 2009-11-30 Javier Miranda * 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 * prj-env.adb (Add_To_Source_Path): Preserve casing of directories 2009-11-30 Vincent Celier * opt.ads (No_Split_Units): New flag initialized to False 2009-11-30 Jerome Lambourg * exp_ch7.adb (Needs_Finalization): Add comments. * exp_ch3.adb (Make_Predefined_Primitive_Specs): Improve handling of CIL Value types. From-SVN: r154809 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 8900a23ac5ba..6477c1e540f3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,24 @@ +2009-11-30 Javier Miranda + + * 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 + + * prj-env.adb (Add_To_Source_Path): Preserve casing of directories + +2009-11-30 Vincent Celier + + * opt.ads (No_Split_Units): New flag initialized to False + +2009-11-30 Jerome Lambourg + + * exp_ch7.adb (Needs_Finalization): Add comments. + * exp_ch3.adb (Make_Predefined_Primitive_Specs): Improve handling of + CIL Value types. + 2009-11-30 Robert Dewar * osint.adb, a-rttiev.adb: Minor reformatting. diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index f32f0e288469..13454c718587 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -8104,6 +8104,11 @@ package body Exp_Ch3 is elsif Restriction_Active (No_Finalization) then null; + -- We skip these for CIL Value types (why???) + + elsif Is_Value_Type (Tag_Typ) then + null; + elsif Etype (Tag_Typ) = Tag_Typ or else Needs_Finalization (Tag_Typ) @@ -8121,9 +8126,7 @@ package body Exp_Ch3 is and then not Is_Limited_Interface (Tag_Typ) and then Is_Limited_Interface (Etype (Tag_Typ))) then - if not Is_Limited_Type (Tag_Typ) - and then not Is_Value_Type (Tag_Typ) - then + if not Is_Limited_Type (Tag_Typ) then Append_To (Res, Predef_Deep_Spec (Loc, Tag_Typ, TSS_Deep_Adjust)); end if; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index c1135407ebd8..1e4ea01141dc 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -2779,6 +2779,19 @@ package body Exp_Ch6 is Unchecked_Convert_To (Parent_Typ, Relocate_Node (Actual))); + -- If the relocated node is a function call then it + -- can be part of the expansion of the predefined + -- equality operator of a tagged type and we may + -- need to adjust its SCIL dispatching node. + + if Generate_SCIL + and then Nkind (Actual) /= N_Null + and then Nkind (Expression (Actual)) + = N_Function_Call + then + Adjust_SCIL_Node (Actual, Expression (Actual)); + end if; + Analyze (Actual); Resolve (Actual, Parent_Typ); end if; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index db3cd20baf1e..880ae4e4cb9e 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))); diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 1bb837a467b4..9013d7d3dcd5 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -861,6 +861,12 @@ package Opt is -- This flag is set True if a No_Run_Time pragma is encountered. See -- spec of Rtsfind for a full description of handling of this pragma. + No_Split_Units : Boolean := False; + -- GPRBUILD + -- Set to True with switch --no-split-units. When True, unit sources, spec, + -- body and subunits, must all be in the same project.This is checked after + -- each compilation. + No_Stdinc : Boolean := False; -- GNAT, GNATBIND, GNATMAKE, GNATFIND, GNATXREF -- Set to True if no default source search dirs added to search list diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb index c5182abea09e..f7fc668dd8f7 100644 --- a/gcc/ada/prj-env.adb +++ b/gcc/ada/prj-env.adb @@ -410,7 +410,7 @@ package body Prj.Env is end loop; if Add_It then - Source_Path_Table.Append (Source_Paths, Source_Dir.Value); + Source_Path_Table.Append (Source_Paths, Source_Dir.Display_Value); end if; -- Next source directory diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb index 977c07d6ddfe..5adf803fc703 100644 --- a/gcc/ada/sem_scil.adb +++ b/gcc/ada/sem_scil.adb @@ -74,7 +74,9 @@ package body Sem_SCIL is -- Type conversions may involve dispatching calls to functions whose -- associated SCIL dispatching node needs adjustment. - elsif Nkind (Old_Node) = N_Type_Conversion then + elsif Nkind_In (Old_Node, N_Type_Conversion, + N_Unchecked_Type_Conversion) + then null; -- Relocated subprogram call