From ce532f42a7efda7280a2cf6b9fb18d48176bae61 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 12 Apr 2013 15:23:23 +0200 Subject: [PATCH] [multiple changes] 2013-04-12 Hristian Kirtchev * sem_prag.adb (Analyze_Input_List): Detect an illegal dependency clause where both input and output lists are null. (Analyze_Pragma): Update the grammar of pragma Depends. 2013-04-12 Vincent Celier * gnatbind.adb (No_Restriction_List): Exclude restrictions that take a parameter value, not a count. * prj.ads, prj.adb (Remove_All_Restricted_Languages): New procedure. * projects.texi: Complete documentation of attribute Roots. 2013-04-12 Thomas Quinot * exp_ch3.adb, exp_util.ads, checks.adb, freeze.adb, sem_attr.adb, sem_ch3.adb: Minor reformatting. * exp_ch4.adb (Size_In_Storage_Elements): Minor documentation improvement: note that the computation is pessimistic for bit packed arrays. * gnat_rm.texi (Range_Length): Fix minor error in description of attribute. From-SVN: r197912 --- gcc/ada/ChangeLog | 23 +++++++++++++++++++++++ gcc/ada/checks.adb | 2 +- gcc/ada/exp_ch3.adb | 8 +++----- gcc/ada/exp_ch4.adb | 4 ++++ gcc/ada/exp_util.ads | 2 +- gcc/ada/freeze.adb | 4 ++-- gcc/ada/gnat_rm.texi | 2 +- gcc/ada/gnatbind.adb | 9 +++++++++ gcc/ada/prj.adb | 11 ++++++++++- gcc/ada/prj.ads | 19 ++++++++++++++++++- gcc/ada/sem_prag.adb | 18 ++++++++++++++++-- 11 files changed, 88 insertions(+), 14 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a4abd21692d..cf86c6f8ccb 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,26 @@ +2013-04-12 Hristian Kirtchev + + * sem_prag.adb (Analyze_Input_List): Detect an illegal dependency + clause where both input and output lists are null. + (Analyze_Pragma): Update the grammar of pragma Depends. + +2013-04-12 Vincent Celier + + * gnatbind.adb (No_Restriction_List): Exclude restrictions that + take a parameter value, not a count. + * prj.ads, prj.adb (Remove_All_Restricted_Languages): New procedure. + * projects.texi: Complete documentation of attribute Roots. + +2013-04-12 Thomas Quinot + + * exp_ch3.adb, exp_util.ads, checks.adb, freeze.adb, sem_attr.adb, + sem_ch3.adb: Minor reformatting. + * exp_ch4.adb (Size_In_Storage_Elements): Minor documentation + improvement: note that the computation is pessimistic for bit + packed arrays. + * gnat_rm.texi (Range_Length): Fix minor error in description + of attribute. + 2013-04-12 Hristian Kirtchev * aspects.adb (Find_Aspect): New routine. diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 5544aad1a46..73aefb0698c 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -996,7 +996,7 @@ package body Checks is elsif Dsiz <= Standard_Long_Long_Integer_Size then Ctyp := Standard_Long_Long_Integer; - -- No check type exists, use runtime call + -- No check type exists, use runtime call else if Nkind (N) = N_Op_Add then diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 5637c2ff754..e16adfb56ca 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -2780,8 +2780,8 @@ package body Exp_Ch3 is -- Loop through components, skipping pragmas, in 2 steps. The first -- step deals with regular components. The second step deals with - -- components have per object constraints, and no explicit initia- - -- lization. + -- components that have per object constraints and no explicit + -- initialization. Has_POC := False; @@ -2799,9 +2799,7 @@ package body Exp_Ch3 is -- Leave any processing of per-object constrained component for -- the second pass. - if Has_Access_Constraint (Id) - and then No (Expression (Decl)) - then + if Has_Access_Constraint (Id) and then No (Expression (Decl)) then Has_POC := True; -- Regular component cases diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index e9458cf6bed..7eca831d277 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4149,6 +4149,10 @@ package body Exp_Ch4 is -- are too large, and which in the absence of a check results in -- undetected chaos ??? + -- Note in particular that this is a pessimistic estimate in the + -- case of packed array types, where an array element might occupy + -- just a fraction of a storage element??? + declare Len : Node_Id; Res : Node_Id; diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 68dc1882e0e..39d1c0b0b84 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -345,7 +345,7 @@ package Exp_Util is -- This procedure ensures that type referenced by Typ is defined. For the -- case of a type other than an Itype, nothing needs to be done, since -- all such types have declaration nodes. For Itypes, an N_Itype_Reference - -- node is generated and inserted at the given node N. This is typically + -- node is generated and inserted as an action on node N. This is typically -- used to ensure that an Itype is properly defined outside a conditional -- construct when it is referenced in more than one branch. diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 234cdd2cb42..6731022c3f5 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2013, 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- -- @@ -3484,7 +3484,7 @@ package body Freeze is Set_Is_Packed (Btyp); Set_Has_Non_Standard_Rep (Btyp); - -- Otherwise give an error message + -- Otherwise give an error message else Error_Msg_NE diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 8e94e4e07a7..29ba6749112 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -7135,7 +7135,7 @@ what is passed to @code{Allocate} and returned from @code{Deallocate}. the number of values represented by the subtype (zero for a null range). The result is static for static subtypes. @code{Range_Length} applied to the index subtype of a one dimensional array always gives the -same result as @code{Range} applied to the array itself. +same result as @code{Length} applied to the array itself. @node Ref @unnumberedsec Ref diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb index 9e451391230..b332b13b85a 100644 --- a/gcc/ada/gnatbind.adb +++ b/gcc/ada/gnatbind.adb @@ -176,6 +176,15 @@ procedure Gnatbind is Max_Storage_At_Blocking => True, -- Not checkable at compile time + No_Specification_Of_Aspect => True, + -- Requires a parameter value, not a count + + No_Use_Of_Attribute => True, + -- Requires a parameter value, not a count + + No_Use_Of_Pragma => True, + -- Requires a parameter value, not a count + others => False); Additional_Restrictions_Listed : Boolean := False; diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index de2254cb222..9e0e0aa38d1 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2013, 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- -- @@ -112,6 +112,15 @@ package body Prj is new Restricted_Lang'(Name => Name_Find, Next => Restricted_Languages); end Add_Restricted_Language; + ------------------------------------- + -- Remove_All_Restricted_Languages -- + ------------------------------------- + + procedure Remove_All_Restricted_Languages is + begin + Restricted_Languages := null; + end Remove_All_Restricted_Languages; + ------------------- -- Add_To_Buffer -- ------------------- diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index 449b038e475..66f878688d0 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2001-2012, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2013, 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- -- @@ -45,6 +45,10 @@ package Prj is -- Call by gprbuild for each language specify by switch -- --restricted-to-languages=. + procedure Remove_All_Restricted_Languages; + -- Call by gprbuild in CodePeer mode to ignore switches + -- --restricted-to-languages=. + function Is_Allowed_Language (Name : Name_Id) return Boolean; -- Returns True if --restricted-to-languages= is not used or if Name -- is one of the restricted languages. @@ -1829,6 +1833,7 @@ package Prj is Gprbuild_Flags : constant Processing_Flags; Gprclean_Flags : constant Processing_Flags; + Gprexec_Flags : constant Processing_Flags; Gnatmake_Flags : constant Processing_Flags; -- Flags used by the various tools. They all display the error messages -- through Prj.Err. @@ -2003,6 +2008,18 @@ private Missing_Source_Files => Error, Ignore_Missing_With => False); + Gprexec_Flags : constant Processing_Flags := + (Report_Error => null, + When_No_Sources => Silent, + Require_Sources_Other_Lang => False, + Allow_Duplicate_Basenames => False, + Compiler_Driver_Mandatory => False, + Error_On_Unknown_Language => True, + Require_Obj_Dirs => Silent, + Allow_Invalid_External => Error, + Missing_Source_Files => Silent, + Ignore_Missing_With => False); + Gnatmake_Flags : constant Processing_Flags := (Report_Error => null, When_No_Sources => Error, diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index d60c41ef956..695bdb7ca40 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -8986,9 +8986,13 @@ package body Sem_Prag is -- null -- | DEPENDENCY_CLAUSE {, DEPENDENCY_CLAUSE} - -- DEPENDENCY_CLAUSE ::= OUTPUT_LIST =>[+] INPUT_LIST + -- DEPENDENCY_CLAUSE ::= + -- OUTPUT_LIST =>[+] INPUT_LIST + -- | NULL_DEPENDENCY_CLAUSE - -- OUTPUT_LIST ::= null | OUTPUT | (OUTPUT {, OUTPUT}) + -- NULL_DEPENDENCY_CLAUSE ::= null => INPUT_LIST + + -- OUTPUT_LIST ::= OUTPUT | (OUTPUT {, OUTPUT}) -- INPUT_LIST ::= null | INPUT | (INPUT {, INPUT}) @@ -9141,6 +9145,16 @@ package body Sem_Prag is Seen => Inputs_Seen, Null_Seen => Null_Input_Seen); end if; + + -- Detect an illegal dependency clause of the form + + -- (null =>[+] null) + + if Null_Output_Seen and then Null_Input_Seen then + Error_Msg_N + ("null dependency clause cannot have a null input list", + Inputs); + end if; end Analyze_Input_List; -------------------------- -- 2.30.2