summaryrefslogtreecommitdiff
path: root/gcc/ada/inline.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-27 13:53:26 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-27 13:53:26 +0000
commit781d856db37632b75dc76c222d8ef81c5a84e63c (patch)
tree63f7052ed1045975db29cac73a1b1a68e9f50ef0 /gcc/ada/inline.adb
parenta10739b2d373b0e1151f4e4c8fd2e6f460621b9d (diff)
downloadgcc-781d856db37632b75dc76c222d8ef81c5a84e63c.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r--gcc/ada/inline.adb17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 0b9affdce7b..a5b1d98bc10 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -410,8 +410,7 @@ package body Inline is
if not Comes_From_Source (N)
and then In_Extended_Main_Source_Unit (N)
- and then
- Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (E)))
+ and then Is_Predefined_Unit (Get_Source_Unit (E))
then
Set_Needs_Debug_Info (E, False);
end if;
@@ -1556,7 +1555,7 @@ package body Inline is
-- subprograms may contain nested subprograms and become ineligible
-- for inlining.
- if Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Subp)))
+ if Is_Predefined_Unit (Get_Source_Unit (Subp))
and then not In_Extended_Main_Source_Unit (Subp)
then
null;
@@ -1602,7 +1601,7 @@ package body Inline is
-- compatibility but it will be removed when we enforce the
-- strictness of the new rules.
- if Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Subp)))
+ if Is_Predefined_Unit (Get_Source_Unit (Subp))
and then not In_Extended_Main_Source_Unit (Subp)
then
null;
@@ -1617,9 +1616,7 @@ package body Inline is
declare
Gen_P : constant Entity_Id := Generic_Parent (Parent (Subp));
begin
- if Is_Predefined_File_Name
- (Unit_File_Name (Get_Source_Unit (Gen_P)))
- then
+ if Is_Predefined_Unit (Get_Source_Unit (Gen_P)) then
Set_Is_Inlined (Subp, False);
Error_Msg_NE (Msg & "p?", N, Subp);
return;
@@ -2283,8 +2280,7 @@ package body Inline is
is
Loc : constant Source_Ptr := Sloc (N);
Is_Predef : constant Boolean :=
- Is_Predefined_File_Name
- (Unit_File_Name (Get_Source_Unit (Subp)));
+ Is_Predefined_Unit (Get_Source_Unit (Subp));
Orig_Bod : constant Node_Id :=
Body_To_Inline (Unit_Declaration_Node (Subp));
@@ -3565,8 +3561,7 @@ package body Inline is
end if;
return Present (Conv)
- and then Is_Predefined_File_Name
- (Unit_File_Name (Get_Source_Unit (Conv)))
+ and then Is_Predefined_Unit (Get_Source_Unit (Conv))
and then Is_Intrinsic_Subprogram (Conv);
end Is_Unchecked_Conversion;