From d27f3ff4c3165d5decf103e63336095730745f82 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 9 Jul 2012 15:24:20 +0200 Subject: [multiple changes] 2012-07-09 Robert Dewar * freeze.adb: Minor code reorganization (use Ekind_In). * exp_attr.adb, sem_ch9.adb par-ch4.adb, s-taprop-mingw.adb, sem_attr.adb, exp_ch8.adb, snames.adb-tmpl, par-util.adb, sem_ch13.adb, snames.ads-tmpl: Minor reformatting. 2012-07-09 Tristan Gingold * raise-gcc.c: Adjust previous patch. 2012-07-09 Vincent Celier * make.adb (Compilation_Phase): Do not build libraries in Codepeer mode (do not call Library_Phase). From-SVN: r189379 --- gcc/ada/ChangeLog | 16 ++++++++++++++++ gcc/ada/exp_attr.adb | 4 ++-- gcc/ada/exp_ch8.adb | 18 ++++++++++++------ gcc/ada/freeze.adb | 8 +++----- gcc/ada/make.adb | 1 + gcc/ada/par-ch4.adb | 3 ++- gcc/ada/par-util.adb | 3 ++- gcc/ada/raise-gcc.c | 2 +- gcc/ada/s-taprop-mingw.adb | 10 ++++++---- gcc/ada/sem_attr.adb | 4 ++-- gcc/ada/sem_ch13.adb | 1 + gcc/ada/sem_ch9.adb | 31 +++++++++++++++---------------- gcc/ada/snames.adb-tmpl | 7 ++++--- gcc/ada/snames.ads-tmpl | 7 +++++-- 14 files changed, 72 insertions(+), 43 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 57d3b04..bdb5318 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2012-07-09 Robert Dewar + + * freeze.adb: Minor code reorganization (use Ekind_In). + * exp_attr.adb, sem_ch9.adb par-ch4.adb, s-taprop-mingw.adb, + sem_attr.adb, exp_ch8.adb, snames.adb-tmpl, par-util.adb, + sem_ch13.adb, snames.ads-tmpl: Minor reformatting. + +2012-07-09 Tristan Gingold + + * raise-gcc.c: Adjust previous patch. + +2012-07-09 Vincent Celier + + * make.adb (Compilation_Phase): Do not build libraries in + Codepeer mode (do not call Library_Phase). + 2012-07-09 Ed Schonberg * sem_ch13.adb: Extend previous change to elementary types. diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 5859b6e..4dbd38f 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -838,8 +838,8 @@ package body Exp_Attr is Attribute_Variable_Indexing => null; - -- Internal attributes used to deal with Ada 2012 delayed aspects - -- (already diagnosed by parser, thus nothing more to do here). + -- Internal attributes used to deal with Ada 2012 delayed aspects. These + -- were already rejected by the parser. Thus they shouldn't appear here. when Attribute_CPU | Attribute_Dispatching_Domain | diff --git a/gcc/ada/exp_ch8.adb b/gcc/ada/exp_ch8.adb index b0e525e..3b5c7d3 100644 --- a/gcc/ada/exp_ch8.adb +++ b/gcc/ada/exp_ch8.adb @@ -243,8 +243,12 @@ package body Exp_Ch8 is Id : constant Entity_Id := Defining_Entity (N); function Build_Body_For_Renaming return Node_Id; - -- Build and return the body for the renaming declaration of an - -- equality or unequality operator. + -- Build and return the body for the renaming declaration of an equality + -- or inequality operator. + + ----------------------------- + -- Build_Body_For_Renaming -- + ----------------------------- function Build_Body_For_Renaming return Node_Id is Body_Id : Entity_Id; @@ -275,10 +279,12 @@ package body Exp_Ch8 is return Decl; end Build_Body_For_Renaming; - -- Local variable + -- Local variables Nam : constant Node_Id := Name (N); + -- Start of processing for Expand_N_Subprogram_Renaming_Declaration + begin -- When the prefix of the name is a function call, we must force the -- call to be made by removing side effects from the call, since we @@ -334,9 +340,9 @@ package body Exp_Ch8 is Expression => Expand_Record_Equality (Id, - Typ => Typ, - Lhs => Make_Identifier (Loc, Chars (Left)), - Rhs => Make_Identifier (Loc, Chars (Right)), + Typ => Typ, + Lhs => Make_Identifier (Loc, Chars (Left)), + Rhs => Make_Identifier (Loc, Chars (Right)), Bodies => Declarations (Decl)))))); Append (Decl, List_Containing (N)); diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 279e08a..850e963 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1908,8 +1908,8 @@ package body Freeze is begin -- Deal with delayed aspect specifications for components. The -- analysis of the aspect is required to be delayed to the freeze - -- point, thus we analyze the pragma or attribute definition clause - -- in the tree at this point. We also analyze the aspect + -- point, thus we analyze the pragma or attribute definition + -- clause in the tree at this point. We also analyze the aspect -- specification node at the freeze point when the aspect doesn't -- correspond to pragma/attribute definition clause. @@ -1955,9 +1955,7 @@ package body Freeze is -- Handle the component and discriminant case - if Ekind (Comp) = E_Component - or else Ekind (Comp) = E_Discriminant - then + if Ekind_In (Comp, E_Component, E_Discriminant) then declare CC : constant Node_Id := Component_Clause (Comp); diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index e43495b..5c35a4e 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -4811,6 +4811,7 @@ package body Make is -- have been regenerated. if Main_Project /= No_Project + and then not Codepeer_Mode and then MLib.Tgt.Support_For_Libraries /= Prj.None and then (Do_Bind_Step or Unique_Compile_All_Projects diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index f16d828..11ef4c7 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -435,7 +435,8 @@ package body Ch4 is Attr_Name := Token_Name; -- Note that internal attributes names don't denote real - -- attribute. + -- attributes, so do not count in this error test. We just + -- want to consider them as not being attribute names. if not Is_Attribute_Name (Attr_Name) or else Is_Internal_Attribute_Name (Attr_Name) diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb index eb19a0a..ec2d478 100644 --- a/gcc/ada/par-util.adb +++ b/gcc/ada/par-util.adb @@ -721,8 +721,9 @@ package body Util is Error_Msg_Name_1 := First_Attribute_Name; while Error_Msg_Name_1 <= Last_Attribute_Name loop + -- No mispelling possible with internal attribute names since they - -- don't denote real attribute. + -- don't denote real attributes. if not Is_Internal_Attribute_Name (Error_Msg_Name_1) and then Is_Bad_Spelling_Of (Token_Name, Error_Msg_Name_1) diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index bc79c5d..8a5dbcf 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -1167,7 +1167,7 @@ __gnat_cleanupunwind_handler (int version, { /* Terminate when the end of the stack is reached. */ if ((phases & _UA_END_OF_STACK) != 0 -#if defined (__ia64__) && defined (USE_LIBUNWIND_EXCEPTIONS) +#if defined (__ia64__) && defined (__hpux__) /* Strictely follow the ia64 ABI: when end of stack is reached, the callback will be called with a NULL stack pointer. No need for that when using libgcc unwinder. */ diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb index 8b38ad8..75d81cb 100644 --- a/gcc/ada/s-taprop-mingw.adb +++ b/gcc/ada/s-taprop-mingw.adb @@ -725,15 +725,17 @@ package body System.Task_Primitives.Operations is pragma Unreferenced (Loss_Of_Inheritance); begin - Res := SetThreadPriority - (T.Common.LL.Thread, Interfaces.C.int (Underlying_Priorities (Prio))); + Res := + SetThreadPriority + (T.Common.LL.Thread, + Interfaces.C.int (Underlying_Priorities (Prio))); pragma Assert (Res = Win32.TRUE); -- Note: Annex D (RM D.2.3(5/2)) requires the task to be placed at the -- head of its priority queue when decreasing its priority as a result -- of a loss of inherited priority. This is not the case, but we - -- consider it an acceptable variation (RM 1.1.3(6)), given this is the - -- built-in behavior offered by the Windows operating system. + -- consider it an acceptable variation (RM 1.1.3(6)), given this is + -- the built-in behavior offered by the Windows operating system. -- In older versions we attempted to better approximate the Annex D -- required behavior, but this simulation was not entirely accurate, diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index dd5faef..71e6d7c 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2215,8 +2215,8 @@ package body Sem_Attr is Attribute_Variable_Indexing => Error_Msg_N ("illegal attribute", N); - -- Internal attributes used to deal with Ada 2012 delayed aspects - -- (already diagnosed by parser, thus nothing more to do here). + -- Internal attributes used to deal with Ada 2012 delayed aspects. These + -- were already rejected by the parser. Thus they shouldn't appear here. when Attribute_CPU | Attribute_Dispatching_Domain | diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 049ba05..a601c7b 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -7741,6 +7741,7 @@ package body Sem_Ch13 is and then Siz > UI_From_Int (Int'Last) then Error_Msg_N ("Size value too large for elementary type", N); + if Nkind (Original_Node (N)) = N_Op_Expon then Error_Msg_N ("\maybe '* was meant, rather than '*'*", Original_Node (N)); diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index d85f279..8c570449 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -138,8 +138,7 @@ package body Sem_Ch9 is Pdef : constant Node_Id := Protected_Definition (N); Priv_Decls : constant List_Id := Private_Declarations (Pdef); Vis_Decls : constant List_Id := Visible_Declarations (Pdef); - - Decl : Node_Id; + Decl : Node_Id; begin -- Examine the visible and the private declarations @@ -152,8 +151,8 @@ package body Sem_Ch9 is if Nkind (Decl) = N_Entry_Declaration then if Complain then - Error_Msg_N ("entry not allowed when Lock_Free given", - Decl); + Error_Msg_N + ("entry not allowed when Lock_Free given", Decl); end if; return False; @@ -162,10 +161,10 @@ package body Sem_Ch9 is -- allowed by the lock-free restrictions. elsif Nkind (Decl) = N_Subprogram_Declaration - and then Nkind (Specification (Decl)) = - N_Procedure_Specification - and then Present - (Parameter_Specifications (Specification (Decl))) + and then + Nkind (Specification (Decl)) = N_Procedure_Specification + and then + Present (Parameter_Specifications (Specification (Decl))) then declare Par_Specs : constant List_Id := @@ -192,8 +191,7 @@ package body Sem_Ch9 is end; end if; - -- Examine the private declarations after the visible - -- declarations. + -- Examine private declarations after visible declarations if No (Next (Decl)) and then List_Containing (Decl) = Vis_Decls @@ -433,14 +431,13 @@ package body Sem_Ch9 is begin Decl := First (Decls); - while Present (Decl) loop if Nkind (Decl) = N_Subprogram_Body and then not Satisfies_Lock_Free_Requirements (Decl) then if Complain then - Error_Msg_N ("body not allowed when Lock_Free given", - Decl); + Error_Msg_N + ("body not allowed when Lock_Free given", Decl); end if; return False; @@ -479,7 +476,7 @@ package body Sem_Ch9 is else if Ada_Version >= Ada_2005 then Error_Msg_N ("expect task name or task interface class-wide " - & "object for ABORT", T_Name); + & "object for ABORT", T_Name); else Error_Msg_N ("expect task name for ABORT", T_Name); end if; @@ -1782,13 +1779,14 @@ package body Sem_Ch9 is -- issued by Allows_Lock_Free_Implementation. if Uses_Lock_Free (Defining_Identifier (N)) then + -- Complain when there is an explicit aspect/pragma Priority (or -- Interrupt_Priority) while the lock-free implementation is forced -- by an aspect/pragma. declare - Id : constant Entity_Id := - Defining_Identifier (Original_Node (N)); + Id : constant Entity_Id := + Defining_Identifier (Original_Node (N)); -- The warning must be issued on the original identifier in order -- to deal properly with the case of a single protected object. @@ -1800,6 +1798,7 @@ package body Sem_Ch9 is begin if Present (Prio_Item) then + -- Aspect case if Nkind (Prio_Item) = N_Aspect_Specification diff --git a/gcc/ada/snames.adb-tmpl b/gcc/ada/snames.adb-tmpl index da17d310..3a22750 100644 --- a/gcc/ada/snames.adb-tmpl +++ b/gcc/ada/snames.adb-tmpl @@ -398,9 +398,10 @@ package body Snames is function Is_Internal_Attribute_Name (N : Name_Id) return Boolean is begin - return N = Name_CPU - or N = Name_Interrupt_Priority - or N = Name_Dispatching_Domain; + return + N = Name_CPU or else + N = Name_Interrupt_Priority or else + N = Name_Dispatching_Domain; end Is_Internal_Attribute_Name; ---------------------------- diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 1697957..03e6a51 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -754,9 +754,12 @@ package Snames is -- section in Sem_Attr. -- The entries marked INT are not real attributes. They are special names - -- used internally by GNAT in order to deal with delayed aspects + -- used internally by GNAT in order to deal with certain delayed aspects -- (Aspect_CPU, Aspect_Dispatching_Domain, Aspect_Interrupt_Priority) that - -- don't have corresponding pragma or attribute. + -- don't have corresponding pragmas or user-referencable attributes. It is + -- convenient to have these internal attributes available in processing + -- the aspects, since the normal approach is to convert an aspect into its + -- corresponding pragma or attribute specification. -- The entries marked VMS are recognized only in OpenVMS implementations -- of GNAT, and are treated as illegal in all other contexts. -- cgit v1.1