From 8ab31c0c31ecf1fa368974dc98196955cb2c25cd Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 27 Apr 2017 15:53:26 +0200 Subject: [multiple changes] 2017-04-27 Eric Botcazou * fe.h (Warn_On_Questionable_Layout): Declare. * warnsw.ads (Warn_On_Record_Holes): Move down. (Warn_On_Questionable_Layout): New boolean variable. (Warning_Record): Add Warn_On_Questionable_Layout field. * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout. (Restore_Warnings): Likewise. (Save_Warnings): Likewise. (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters. * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to components_to_record. (gnu_field_to_gnat): New function. (warn_on_field_placement): Likewise. (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER parameters. Rename local variables and adjust recursive call. Rework final scan of the field list and implement warnings on the problematic placement of specific sorts of fields. 2017-04-27 Bob Duff * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb, * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb, * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb, * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb, * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb, * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb: For efficiency, cache results of Is_Internal_File_Name and Is_Predefined_File_Name in the Units table. This avoids a lot of repeated text processing. 2017-04-27 Emmanuel Briot * g-comlin.adb (Sort_Sections): remove useless test. 2017-04-27 Claire Dross * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to allow the use of regular equality over elements in contracts. (Formal_Model): Ghost package containing model functions that are used in subprogram contracts. (Current_To_Last): Removed, model functions should be used instead. (First_To_Previous): Removed, model functions should be used instead. (Strict_Equal): Removed, model functions should be used instead. (No_Overlap): Removed, model functions should be used instead. (Equivalent_Keys): Functions over cursors are removed. They were awkward with explicit container parameters. * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to allow the use of regular equality over elements in contracts. (Formal_Model): Ghost package containing model functions that are used in subprogram contracts. (Current_To_Last): Removed, model functions should be used instead. (First_To_Previous): Removed, model functions should be used instead. (Strict_Equal): Removed, model functions should be used instead. (No_Overlap): Removed, model functions should be used instead. 2017-04-27 Yannick Moy * gnat1drv.adb: Code cleanup. 2017-04-27 Ed Schonberg * exp_util.adb (Replace_Entity): The prefix of a 'Result attribute reference in a post- condition is the subprogram to which the condition applies. If the condition is inherited by a type extension, the prefix becomes a reference to the inherited operation, but there is no need to create a wrapper for this operation, because 'Result is expanded independently when elaborating the postconditions. From-SVN: r247338 --- gcc/ada/sem_cat.adb | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'gcc/ada/sem_cat.adb') diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index 9212783..82c4a6a 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -29,7 +29,6 @@ with Einfo; use Einfo; with Elists; use Elists; with Errout; use Errout; with Exp_Disp; use Exp_Disp; -with Fname; use Fname; with Lib; use Lib; with Namet; use Namet; with Nlists; use Nlists; @@ -263,8 +262,8 @@ package body Sem_Cat is -- so it is convenient not to generate them (since it causes -- annoying interference with debugging). - if Is_Internal_File_Name (Unit_File_Name (Current_Sem_Unit)) - and then not Is_Internal_File_Name (Unit_File_Name (Main_Unit)) + if Is_Internal_Unit (Current_Sem_Unit) + and then not Is_Internal_Unit (Main_Unit) then return; @@ -949,8 +948,7 @@ package body Sem_Cat is if Is_Private_Type (T) and then not Has_Pragma_Preelab_Init (T) - and then not Is_Internal_File_Name - (Unit_File_Name (Get_Source_Unit (N))) + and then not In_Internal_Unit (N) then Error_Msg_N ("private ancestor type not allowed in preelaborated unit", A); @@ -1098,8 +1096,7 @@ package body Sem_Cat is if In_Preelaborated_Unit and then not Debug_Flag_PP and then Comes_From_Source (E) - and then not - Is_Internal_File_Name (Unit_File_Name (Get_Source_Unit (E))) + and then not In_Internal_Unit (E) and then (not Inside_A_Generic or else Present (Enclosing_Generic_Body (E))) and then not Is_Protected_Type (Etype (E)) @@ -2202,7 +2199,7 @@ package body Sem_Cat is E := Entity (N); Val := Constant_Value (E); - if Is_Internal_File_Name (Unit_File_Name (Get_Source_Unit (N))) + if In_Internal_Unit (N) and then Enclosing_Comp_Unit_Node (N) /= Enclosing_Comp_Unit_Node (E) and then (Is_Preelaborated (Scope (E)) -- cgit v1.1