aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-writ.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 15:53:26 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2017-04-27 15:53:26 +0200
commit8ab31c0c31ecf1fa368974dc98196955cb2c25cd (patch)
tree63f7052ed1045975db29cac73a1b1a68e9f50ef0 /gcc/ada/lib-writ.adb
parenta2168462958f03ca5b060ad49e217a3e262750d0 (diff)
downloadgcc-8ab31c0c31ecf1fa368974dc98196955cb2c25cd.zip
gcc-8ab31c0c31ecf1fa368974dc98196955cb2c25cd.tar.gz
gcc-8ab31c0c31ecf1fa368974dc98196955cb2c25cd.tar.bz2
[multiple changes]
2017-04-27 Eric Botcazou <ebotcazou@adacore.com> * 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 <duff@adacore.com> * 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 <briot@adacore.com> * g-comlin.adb (Sort_Sections): remove useless test. 2017-04-27 Claire Dross <dross@adacore.com> * 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 <moy@adacore.com> * gnat1drv.adb: Code cleanup. 2017-04-27 Ed Schonberg <schonberg@adacore.com> * 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
Diffstat (limited to 'gcc/ada/lib-writ.adb')
-rw-r--r--gcc/ada/lib-writ.adb109
1 files changed, 57 insertions, 52 deletions
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index f69e4ac..895e185 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -74,28 +74,32 @@ package body Lib.Writ is
begin
Units.Increment_Last;
Units.Table (Units.Last) :=
- (Unit_File_Name => File_Name (S),
- Unit_Name => No_Unit_Name,
- Expected_Unit => No_Unit_Name,
- Source_Index => S,
- Cunit => Empty,
- Cunit_Entity => Empty,
- Dependency_Num => 0,
- Dynamic_Elab => False,
- Fatal_Error => None,
- Generate_Code => False,
- Has_RACW => False,
- Filler => False,
- Ident_String => Empty,
- Loading => False,
- Main_Priority => -1,
- Main_CPU => -1,
- Munit_Index => 0,
- No_Elab_Code_All => False,
- Serial_Number => 0,
- Version => 0,
- Error_Location => No_Location,
- OA_Setting => 'O');
+ (Unit_File_Name => File_Name (S),
+ Unit_Name => No_Unit_Name,
+ Expected_Unit => No_Unit_Name,
+ Source_Index => S,
+ Cunit => Empty,
+ Cunit_Entity => Empty,
+ Dependency_Num => 0,
+ Dynamic_Elab => False,
+ Fatal_Error => None,
+ Generate_Code => False,
+ Has_RACW => False,
+ Filler => False,
+ Ident_String => Empty,
+ Is_Predefined_Renaming => False,
+ Is_Internal_Unit => False,
+ Is_Predefined_Unit => False,
+ Filler2 => False,
+ Loading => False,
+ Main_Priority => -1,
+ Main_CPU => -1,
+ Munit_Index => 0,
+ No_Elab_Code_All => False,
+ Serial_Number => 0,
+ Version => 0,
+ Error_Location => No_Location,
+ OA_Setting => 'O');
end Add_Preprocessing_Dependency;
------------------------------
@@ -130,29 +134,33 @@ package body Lib.Writ is
System_Fname := File_Name (System_Source_File_Index);
Units.Increment_Last;
- Units.Table (Units.Last) := (
- Unit_File_Name => System_Fname,
- Unit_Name => System_Uname,
- Expected_Unit => System_Uname,
- Source_Index => System_Source_File_Index,
- Cunit => Empty,
- Cunit_Entity => Empty,
- Dependency_Num => 0,
- Dynamic_Elab => False,
- Fatal_Error => None,
- Generate_Code => False,
- Has_RACW => False,
- Filler => False,
- Ident_String => Empty,
- Loading => False,
- Main_Priority => -1,
- Main_CPU => -1,
- Munit_Index => 0,
- No_Elab_Code_All => False,
- Serial_Number => 0,
- Version => 0,
- Error_Location => No_Location,
- OA_Setting => 'O');
+ Units.Table (Units.Last) :=
+ (Unit_File_Name => System_Fname,
+ Unit_Name => System_Uname,
+ Expected_Unit => System_Uname,
+ Source_Index => System_Source_File_Index,
+ Cunit => Empty,
+ Cunit_Entity => Empty,
+ Dependency_Num => 0,
+ Dynamic_Elab => False,
+ Fatal_Error => None,
+ Generate_Code => False,
+ Has_RACW => False,
+ Filler => False,
+ Ident_String => Empty,
+ Is_Predefined_Renaming => False,
+ Is_Internal_Unit => True,
+ Is_Predefined_Unit => True,
+ Filler2 => False,
+ Loading => False,
+ Main_Priority => -1,
+ Main_CPU => -1,
+ Munit_Index => 0,
+ No_Elab_Code_All => False,
+ Serial_Number => 0,
+ Version => 0,
+ Error_Location => No_Location,
+ OA_Setting => 'O');
-- Parse system.ads so that the checksum is set right. Style checks are
-- not applied. The Ekind is set to ensure that this reference is always
@@ -533,7 +541,7 @@ package body Lib.Writ is
Write_Info_Str (" GE");
end if;
- if not Is_Internal_File_Name (Unit_File_Name (Unit_Num), True) then
+ if not Is_Internal_Unit (Unit_Num) then
case Identifier_Casing (Source_Index (Unit_Num)) is
when All_Lower_Case => Write_Info_Str (" IL");
when All_Upper_Case => Write_Info_Str (" IU");
@@ -618,8 +626,7 @@ package body Lib.Writ is
-- parameters (see Lib_Writ spec for an explanation).
if Is_Generic_Unit (Cunit_Entity (Main_Unit))
- and then
- Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit))
+ and then Is_Predefined_Unit (Current_Sem_Unit)
and then Linker_Option_Lines.Table (J).Unit = Unit_Num
then
Set_Standard_Error;
@@ -858,7 +865,7 @@ package body Lib.Writ is
if not ((Nkind (Unit (Cunit)) in N_Generic_Declaration
or else
Nkind (Unit (Cunit)) in N_Generic_Renaming_Declaration)
- and then Generic_May_Lack_ALI (Fname))
+ and then Generic_May_Lack_ALI (Unum))
-- In SPARK mode, always generate the dependencies on ALI
-- files, which are required to compute frame conditions
@@ -1160,9 +1167,7 @@ package body Lib.Writ is
Write_Info_Str (" DB");
end if;
- if Tasking_Used
- and then not Is_Predefined_File_Name (Unit_File_Name (Main_Unit))
- then
+ if Tasking_Used and then not Is_Predefined_Unit (Main_Unit) then
if Locking_Policy /= ' ' then
Write_Info_Str (" L");
Write_Info_Char (Locking_Policy);