summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-06 09:44:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2017-09-06 09:44:29 +0000
commit3645e9c5fc96e1b3383cdfcea5e8bc5e5963c45c (patch)
tree3927435d4fc7bbbdc970057a5a4e68969549dda0 /gcc/ada/sem_util.adb
parentbf5f89dc474c0db6e5f43ad4b74949d9c21b8f35 (diff)
downloadgcc-3645e9c5fc96e1b3383cdfcea5e8bc5e5963c45c.tar.gz
2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
* ali.ads (ALIs_Record): Add No_Component_Reordering component. (No_Component_Reordering_Specified): New switch. * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified. (Scan_ALI): Set No_Component_Reordering and deal with NC marker. * bcheck.adb (Check_Consistent_No_Component_Reordering): New check. (Check_Configuration_Consistency): Invoke it. * debug.adb (d.r): Toggle the effect of the switch. (d.v): Change to no-op. * einfo.ads (Has_Complex_Representation): Restrict to record types. (No_Reordering): New alias for Flag239. (OK_To_Reorder_Components): Delete. (No_Reordering): Declare. (Set_No_Reordering): Likewise. (OK_To_Reorder_Components): Delete. (Set_OK_To_Reorder_Components): Likewise. * einfo.adb (Has_Complex_Representation): Expect record types. (No_Reordering): New function. (OK_To_Reorder_Components): Delete. (Set_Has_Complex_Representation): Expect base record types. (Set_No_Reordering): New procedure. (Set_OK_To_Reorder_Components): Delete. (Write_Entity_Flags): Adjust to above change. * fe.h (Debug_Flag_Dot_R): New macro and declaration. * freeze.adb (Freeze_Record_Type): Remove conditional code setting OK_To_Reorder_Components on record types with convention Ada. * lib-writ.adb (Write_ALI): Deal with NC marker. * opt.ads (No_Component_Reordering): New flag. (No_Component_Reordering_Config): Likewise. (Config_Switches_Type): Add No_Component_Reordering component. * opt.adb (Register_Opt_Config_Switches): Copy No_Component_Reordering onto No_Component_Reordering_Config. (Restore_Opt_Config_Switches): Restore No_Component_Reordering. (Save_Opt_Config_Switches): Save No_Component_Reordering. (Set_Opt_Config_Switches): Set No_Component_Reordering. * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering. * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the No_Reordering flag from the default. (Build_Derived_Private_Type): Likewise. (Build_Derived_Record_Type): Likewise. Then inherit it for untagged types and clean up handling of similar flags. (Record_Type_Declaration): Likewise. * sem_ch13.adb (Same_Representation): Deal with No_Reordering and remove redundant test on Is_Tagged_Type. * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering. (Sig_Flags): Likewise. * snames.ads-tmpl (Name_No_Component_Reordering): New name. (Pragma_Id): Add Pragma_No_Component_Reordering value. * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Copy the layout of the parent type only if the No_Reordering settings match. (components_to_record): Reorder record types with convention Ada by default unless No_Reordering is set or -gnatd.r is specified and do not warn if No_Reordering is set in GNAT mode. 2017-09-06 Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure): new predicate to reject declarations that can be completions, when there is a visible prior homograph that is a null procedure. * sem_ch6.adb (Analyze_Null_Procedure): use it. * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto. 2017-09-06 Thomas Quinot <quinot@adacore.com> * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal run of 253 characters or more. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index d9babcd8b3b..6126b201e50 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -1900,6 +1900,25 @@ package body Sem_Util is
end if;
end Cannot_Raise_Constraint_Error;
+ ------------------------------------
+ -- Check_Previous_Null_Procedure --
+ ------------------------------------
+
+ procedure Check_Previous_Null_Procedure
+ (Decl : Node_Id;
+ Prev : Entity_Id)
+ is
+ begin
+ if Ekind (Prev) = E_Procedure
+ and then Nkind (Parent (Prev)) = N_Procedure_Specification
+ and then Null_Present (Parent (Prev))
+ then
+ Error_Msg_Sloc := Sloc (Prev);
+ Error_Msg_N
+ ("declaration cannot complete previous null procedure#", Decl);
+ end if;
+ end Check_Previous_Null_Procedure;
+
-----------------------------
-- Check_Part_Of_Reference --
-----------------------------