diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-27 15:53:26 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-27 15:53:26 +0200 |
commit | 8ab31c0c31ecf1fa368974dc98196955cb2c25cd (patch) | |
tree | 63f7052ed1045975db29cac73a1b1a68e9f50ef0 /gcc/ada/lib.ads | |
parent | a2168462958f03ca5b060ad49e217a3e262750d0 (diff) | |
download | gcc-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.ads')
-rw-r--r-- | gcc/ada/lib.ads | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index 54480e4..a5b9858 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -327,6 +327,19 @@ package Lib is -- N_String_Literal node from a valid pragma Ident that applies to -- this unit. If no Ident pragma applies to the unit, then Empty. + -- Is_Predefined_Renaming + -- True if this unit is a predefined renaming, as in "Text_IO renames + -- Ada.Text_IO"). + + -- Is_Internal_Unit + -- Same as In_Predefined_Unit, except units in the GNAT hierarchy are + -- included. + + -- Is_Predefined_Unit + -- True if this unit is predefined (i.e. part of the Ada, System, or + -- Interface hierarchies, or Is_Predefined_Renaming). Note that units + -- in the GNAT hierarchy are not considered predefined. + -- Loading -- A flag that is used to catch circular WITH dependencies. It is set -- True when an entry is initially created in the file table, and set @@ -428,6 +441,9 @@ package Lib is function Generate_Code (U : Unit_Number_Type) return Boolean; function Ident_String (U : Unit_Number_Type) return Node_Id; function Has_RACW (U : Unit_Number_Type) return Boolean; + function Is_Predefined_Renaming (U : Unit_Number_Type) return Boolean; + function Is_Internal_Unit (U : Unit_Number_Type) return Boolean; + function Is_Predefined_Unit (U : Unit_Number_Type) return Boolean; function Loading (U : Unit_Number_Type) return Boolean; function Main_CPU (U : Unit_Number_Type) return Int; function Main_Priority (U : Unit_Number_Type) return Int; @@ -493,7 +509,7 @@ package Lib is -- Return the Nth stored compilation switch, or null if less than N -- switches have been stored. Used by ASIS and back ends written in Ada. - function Generic_May_Lack_ALI (Sfile : File_Name_Type) return Boolean; + function Generic_May_Lack_ALI (Unum : Unit_Number_Type) return Boolean; -- Generic units must be separately compiled. Since we always use -- macro substitution for generics, the resulting object file is a dummy -- one with no code, but the ALI file has the normal form, and we need @@ -597,13 +613,20 @@ package Lib is -- of the descendant packages of one of these three packages). function In_Predefined_Unit (S : Source_Ptr) return Boolean; + pragma Inline (In_Predefined_Unit); -- Same function as above but argument is a source pointer function In_Internal_Unit (N : Node_Or_Entity_Id) return Boolean; function In_Internal_Unit (S : Source_Ptr) return Boolean; + pragma Inline (In_Internal_Unit); -- Same as In_Predefined_Unit, except units in the GNAT hierarchy are -- included. + function In_Predefined_Renaming (N : Node_Or_Entity_Id) return Boolean; + function In_Predefined_Renaming (S : Source_Ptr) return Boolean; + pragma Inline (In_Predefined_Renaming); + -- Returns True if N or S is in a predefined renaming unit + function In_Same_Code_Unit (N1, N2 : Node_Or_Entity_Id) return Boolean; pragma Inline (In_Same_Code_Unit); -- Determines if the two nodes or entities N1 and N2 are in the same @@ -776,6 +799,9 @@ private pragma Inline (Set_Fatal_Error); pragma Inline (Set_Generate_Code); pragma Inline (Set_Has_RACW); + pragma Inline (Is_Predefined_Renaming); + pragma Inline (Is_Internal_Unit); + pragma Inline (Is_Predefined_Unit); pragma Inline (Set_Loading); pragma Inline (Set_Main_CPU); pragma Inline (Set_Main_Priority); @@ -811,6 +837,11 @@ private Filler : Boolean; Loading : Boolean; OA_Setting : Character; + + Is_Predefined_Renaming : Boolean; + Is_Internal_Unit : Boolean; + Is_Predefined_Unit : Boolean; + Filler2 : Boolean; end record; -- The following representation clause ensures that the above record @@ -840,9 +871,14 @@ private Filler at 61 range 0 .. 7; OA_Setting at 62 range 0 .. 7; Loading at 63 range 0 .. 7; + + Is_Predefined_Renaming at 64 range 0 .. 7; + Is_Internal_Unit at 65 range 0 .. 7; + Is_Predefined_Unit at 66 range 0 .. 7; + Filler2 at 67 range 0 .. 7; end record; - for Unit_Record'Size use 64 * 8; + for Unit_Record'Size use 68 * 8; -- This ensures that we did not leave out any fields package Units is new Table.Table ( |