From 40417de8ab869572f58b96b987ad4fca4f0cd783 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 20 Oct 2015 11:42:53 +0200 Subject: [PATCH] [multiple changes] 2015-10-20 Vincent Celier * prj-attr.adb: Add package Codepeer and its attributes. 2015-10-20 Thomas Quinot * sem_ch3.adb, sem_ch13.adb: Minor reformatting. 2015-10-20 Eric Botcazou * gnatlink.adb (Gnatlink): Do not translate --RTS switch for the linker and instead pass the switches that were reinstated by the compiler. 2015-10-20 Bob Duff * a-contai.ads, a-convec.ads: Move Count_Type_Last from a-convec.ads to a-contai.ads, so other containers can refer to it. From-SVN: r229027 --- gcc/ada/ChangeLog | 19 +++++++++++++++++ gcc/ada/a-contai.ads | 4 ++++ gcc/ada/a-convec.ads | 5 +---- gcc/ada/gnatlink.adb | 49 +++++++++++++++++++++++--------------------- gcc/ada/prj-attr.adb | 12 ++++++++++- gcc/ada/sem_ch13.adb | 8 ++++---- gcc/ada/sem_ch3.adb | 2 +- 7 files changed, 66 insertions(+), 33 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 2bfc5079f54..3b1a4eb2538 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,22 @@ +2015-10-20 Vincent Celier + + * prj-attr.adb: Add package Codepeer and its attributes. + +2015-10-20 Thomas Quinot + + * sem_ch3.adb, sem_ch13.adb: Minor reformatting. + +2015-10-20 Eric Botcazou + + * gnatlink.adb (Gnatlink): Do not translate --RTS switch + for the linker and instead pass the switches that were + reinstated by the compiler. + +2015-10-20 Bob Duff + + * a-contai.ads, a-convec.ads: Move Count_Type_Last from + a-convec.ads to a-contai.ads, so other containers can refer to it. + 2015-10-20 Ed Schonberg * sem_ch3.adb (Check_Nonoverridable_Aspects): New procedure within diff --git a/gcc/ada/a-contai.ads b/gcc/ada/a-contai.ads index 26f1f8d5ce9..02dc28f26a3 100644 --- a/gcc/ada/a-contai.ads +++ b/gcc/ada/a-contai.ads @@ -34,6 +34,10 @@ package Ada.Containers is private + Count_Type_Last : constant := Count_Type'Last; + -- Count_Type'Last as a universal_integer, so we can compare Index_Type + -- values against this without type conversions that might overflow. + type Tamper_Counts is record Busy : Natural := 0; Lock : Natural := 0; diff --git a/gcc/ada/a-convec.ads b/gcc/ada/a-convec.ads index e494386504d..0356431772a 100644 --- a/gcc/ada/a-convec.ads +++ b/gcc/ada/a-convec.ads @@ -370,6 +370,7 @@ private use Implementation; type Elements_Array is array (Index_Type range <>) of aliased Element_Type; + function "=" (L, R : Elements_Array) return Boolean is abstract; type Elements_Type (Last : Extended_Index) is limited record EA : Elements_Array (Index_Type'First .. Last); @@ -490,10 +491,6 @@ private Empty_Vector : constant Vector := (Controlled with others => <>); - Count_Type_Last : constant := Count_Type'Last; - -- Count_Type'Last as a universal_integer, so we can compare Index_Type - -- values against this without type conversions that might overflow. - type Iterator is new Limited_Controlled and Vector_Iterator_Interfaces.Reversible_Iterator with record diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index e94cae9af90..f50c946eba9 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -1539,8 +1539,7 @@ begin loop -- Do not compile with the front end switches. However, --RTS -- is to be dealt with specially because it needs to be passed - -- if the binder-generated file is in Ada and may also be used - -- to drive the linker. + -- to compile the file generated by the binder. declare Arg : String_Ptr renames Args.Table (Index); @@ -1550,6 +1549,31 @@ begin Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) := String_Access (Arg); + -- GNAT doesn't support GCC's multilib mechanism when it + -- is configured with --disable-libada. This means that, + -- when a multilib switch is used to request a particular + -- compilation mode, the corresponding --RTS switch must + -- also be specified. It is convenient to eliminate the + -- redundancy by keying the compilation mode on a single + -- switch, namely --RTS, and have the compiler reinstate + -- the multilib switch (see gcc-interface/lang-specs.h). + -- This switch must be passed to the driver at link time. + + if Arg'Length = 5 + and then Arg (Arg'First + 1 .. Arg'First + 4) = "mrtp" + then + Linker_Options.Increment_Last; + Linker_Options.Table + (Linker_Options.Last) := String_Access (Arg); + + elsif Arg'Length = 6 + and then Arg (Arg'First + 1 .. Arg'First + 5) = "fsjlj" + then + Linker_Options.Increment_Last; + Linker_Options.Table + (Linker_Options.Last) := String_Access (Arg); + end if; + elsif Arg'Length > 5 and then Arg (Arg'First + 2 .. Arg'First + 5) = "RTS=" then @@ -1568,27 +1592,6 @@ begin Opt.RTS_Lib_Path_Name := Get_RTS_Search_Dir (Arg (Arg'First + 6 .. Arg'Last), Objects); - - -- GNAT doesn't support the GCC multilib mechanism. - -- This means that, when a multilib switch is used - -- to request a particular compilation mode, the - -- corresponding runtime switch (--RTS) must also be - -- specified. The long-term goal is to fully support the - -- multilib mechanism; however, in the meantime, it is - -- convenient to eliminate the redundancy by keying the - -- compilation mode on a single switch, namely --RTS. - - -- Pass -mrtp to the linker if --RTS=rtp was passed - - if Arg'Length > 8 - and then - (Arg (Arg'First + 6 .. Arg'First + 8) = "rtp" - or else Arg (Arg'Last - 2 .. Arg'Last) = "rtp") - then - Linker_Options.Increment_Last; - Linker_Options.Table (Linker_Options.Last) := - new String'("-mrtp"); - end if; end if; end; end loop; diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 201d6b8636c..66de7c71601 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -379,6 +379,16 @@ package body Prj.Attr is "Pstack#" & "LVswitches#" & + -- package Codepeer + + "Pcodepeer#" & + "SVoutput_directory#" & + "SVdatabase_directory#" & + "SVmessage_patterns#" & + "SVadditional_patterns#" & + "LVswitches#" & + "LVexcluded_source_files#" & + "#"; Initialized : Boolean := False; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 5de48ddbfae..c3af7ce488b 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1447,9 +1447,6 @@ package body Sem_Ch13 is Disc : Entity_Id; Parent_Disc : Entity_Id; - -- For a type extension, check whether parent has a - -- reference discriminant, to verify that use is proper. - begin if not Is_Type (E) or else not Has_Discriminants (E) then Error_Msg_N @@ -1474,7 +1471,7 @@ package body Sem_Ch13 is Next_Discriminant (Disc); end loop; - -- Error if no proper access discriminant. + -- Error if no proper access discriminant if No (Disc) then Error_Msg_NE @@ -1483,6 +1480,9 @@ package body Sem_Ch13 is end if; end if; + -- For a type extension, check whether parent has a + -- reference discriminant, to verify that use is proper. + if Is_Derived_Type (E) and then Has_Discriminants (Etype (E)) then diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 2000f425bfb..2649f4d8bb4 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -2615,7 +2615,7 @@ package body Sem_Ch3 is return False; end Has_Aspect_Spec; - -- Start of processing for Check_Nonoverridable_Aspects + -- Start of processing for Check_Nonoverridable_Aspects begin -- 2.30.2