diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-29 14:01:21 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-29 14:01:21 +0000 |
commit | 37f757cf7679e0762e5c3a3e864665c1f9cdad70 (patch) | |
tree | c97baf59573b2e4562047b821947b9c984abb702 /gcc | |
parent | bc054fa5c69b4f4b688ca9c761ba16ea5e5d1db0 (diff) | |
download | gcc-37f757cf7679e0762e5c3a3e864665c1f9cdad70.tar.gz |
2013-01-29 Robert Dewar <dewar@adacore.com>
* atree.ads, atree.adb (Node30): New function.
(Set_Node30): New procedure.
(Num_Extension_Nodes): Change to 5 (activate new fields/flags).
* atree.h: Add macros for Field30 and Node30.
* einfo.ads, einfo.adb: Move some fields to avoid duplexing.
* treepr.adb (Print_Entity_Information): Print fields 30-35.
2013-01-29 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Interface): Consider to
be a violation of No_Obsolescent_Features even in Ada 95. Also
generates a warning in -gnatwj mode.
(Analyze_Pragma, case Interface_Name): Generates a warning in -gnatwj
mode.
* gnat_ugn.texi: Additional documentation on -gnatwj and pragma
Interface[_Name].
2013-01-29 Vincent Celier <celier@adacore.com>
* snames.ads-tmpl: Add new standard name Trailing_Switches.
2013-01-29 Ed Schonberg <schonberg@adacore.com>
* sem_disp.adb (Check_Controlling_Type): If a designated type T
of an anonymous access type is a limited view of a tagged type,
it can be a controlling type only if the subprogram is in the
same scope as T.
2013-01-29 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Use the project where the config pragmas file is
declared to get its path.
2013-01-29 Vincent Celier <celier@adacore.com>
* prj-attr.adb: New attribute Linker'Trailing_Switches.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 39 | ||||
-rw-r--r-- | gcc/ada/atree.adb | 14 | ||||
-rw-r--r-- | gcc/ada/atree.ads | 13 | ||||
-rw-r--r-- | gcc/ada/atree.h | 4 | ||||
-rw-r--r-- | gcc/ada/einfo.adb | 116 | ||||
-rw-r--r-- | gcc/ada/einfo.ads | 16 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 4 | ||||
-rw-r--r-- | gcc/ada/gnatcmd.adb | 10 | ||||
-rw-r--r-- | gcc/ada/prj-attr.adb | 1 | ||||
-rw-r--r-- | gcc/ada/sem_disp.adb | 1 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 25 | ||||
-rw-r--r-- | gcc/ada/snames.ads-tmpl | 1 | ||||
-rw-r--r-- | gcc/ada/treepr.adb | 48 |
13 files changed, 249 insertions, 43 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d6a579e02ff..dd264546984 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,42 @@ +2013-01-29 Robert Dewar <dewar@adacore.com> + + * atree.ads, atree.adb (Node30): New function. + (Set_Node30): New procedure. + (Num_Extension_Nodes): Change to 5 (activate new fields/flags). + * atree.h: Add macros for Field30 and Node30. + * einfo.ads, einfo.adb: Move some fields to avoid duplexing. + * treepr.adb (Print_Entity_Information): Print fields 30-35. + +2013-01-29 Robert Dewar <dewar@adacore.com> + + * sem_prag.adb (Analyze_Pragma, case Interface): Consider to + be a violation of No_Obsolescent_Features even in Ada 95. Also + generates a warning in -gnatwj mode. + (Analyze_Pragma, case Interface_Name): Generates a warning in -gnatwj + mode. + * gnat_ugn.texi: Additional documentation on -gnatwj and pragma + Interface[_Name]. + +2013-01-29 Vincent Celier <celier@adacore.com> + + * snames.ads-tmpl: Add new standard name Trailing_Switches. + +2013-01-29 Ed Schonberg <schonberg@adacore.com> + + * sem_disp.adb (Check_Controlling_Type): If a designated type T + of an anonymous access type is a limited view of a tagged type, + it can be a controlling type only if the subprogram is in the + same scope as T. + +2013-01-29 Vincent Celier <celier@adacore.com> + + * gnatcmd.adb: Use the project where the config pragmas file is + declared to get its path. + +2013-01-29 Vincent Celier <celier@adacore.com> + + * prj-attr.adb: New attribute Linker'Trailing_Switches. + 2013-01-22 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/trans.c (gnat_to_gnu) <N_Expression_With_Actions>: Do diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index 01fc081c5c8..b287b57302d 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -522,7 +522,7 @@ package body Atree is -- entries in this table. Normal programs won't use it at all. type Paren_Count_Entry is record - Nod : Node_Id; + Nod : Node_Id; -- The node to which this count applies Count : Nat range 3 .. Nat'Last; @@ -2520,6 +2520,12 @@ package body Atree is return Node_Id (Nodes.Table (N + 4).Field11); end Node29; + function Node30 (N : Node_Id) return Node_Id is + begin + pragma Assert (Nkind (N) in N_Entity); + return Node_Id (Nodes.Table (N + 5).Field6); + end Node30; + function List1 (N : Node_Id) return List_Id is begin pragma Assert (N <= Nodes.Last); @@ -5219,6 +5225,12 @@ package body Atree is Nodes.Table (N + 4).Field11 := Union_Id (Val); end Set_Node29; + procedure Set_Node30 (N : Node_Id; Val : Node_Id) is + begin + pragma Assert (Nkind (N) in N_Entity); + Nodes.Table (N + 5).Field6 := Union_Id (Val); + end Set_Node30; + procedure Set_List1 (N : Node_Id; Val : List_Id) is begin pragma Assert (N <= Nodes.Last); diff --git a/gcc/ada/atree.ads b/gcc/ada/atree.ads index 2b616bd2796..fc60293d65b 100644 --- a/gcc/ada/atree.ads +++ b/gcc/ada/atree.ads @@ -69,12 +69,13 @@ package Atree is -- Size of Entities -- ---------------------- - -- Currently entities are composed of 5 sequentially allocated 32-byte + -- Currently entities are composed of 6 sequentially allocated 32-byte -- nodes, considered as a single record. The following definition gives -- the number of extension nodes. - Num_Extension_Nodes : Int := 4; - -- This value is increased by one if debug flag -gnatd.N is set + Num_Extension_Nodes : Int := 5; + -- This value is increased by one if debug flag -gnatd.N is set. This is + -- for testing performance impact of adding a new extension node. ---------------------------------------- -- Definitions of Fields in Tree Node -- @@ -1167,6 +1168,9 @@ package Atree is function Node29 (N : Node_Id) return Node_Id; pragma Inline (Node29); + function Node30 (N : Node_Id) return Node_Id; + pragma Inline (Node30); + function List1 (N : Node_Id) return List_Id; pragma Inline (List1); @@ -2446,6 +2450,9 @@ package Atree is procedure Set_Node29 (N : Node_Id; Val : Node_Id); pragma Inline (Set_Node29); + procedure Set_Node30 (N : Node_Id; Val : Node_Id); + pragma Inline (Set_Node30); + procedure Set_List1 (N : Node_Id; Val : List_Id); pragma Inline (Set_List1); diff --git a/gcc/ada/atree.h b/gcc/ada/atree.h index 822b30d34ba..7d88c4d102c 100644 --- a/gcc/ada/atree.h +++ b/gcc/ada/atree.h @@ -6,7 +6,7 @@ * * * C Header File * * * - * Copyright (C) 1992-2011, Free Software Foundation, Inc. * + * Copyright (C) 1992-2012, 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- * @@ -387,6 +387,7 @@ extern Node_Id Current_Error_Node; #define Field27(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field9) #define Field28(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field10) #define Field29(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.X.field11) +#define Field30(N) (Nodes_Ptr[(N) - First_Node_Id + 4].V.EX.field6) #define Node1(N) Field1 (N) #define Node2(N) Field2 (N) @@ -417,6 +418,7 @@ extern Node_Id Current_Error_Node; #define Node27(N) Field27 (N) #define Node28(N) Field28 (N) #define Node29(N) Field29 (N) +#define Node30(N) Field30 (N) #define List1(N) Field1 (N) #define List2(N) Field2 (N) diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index ef4f191ffd1..6d87f98510b 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -108,7 +108,6 @@ package body Einfo is -- Esize Uint12 -- Next_Inlined_Subprogram Node12 - -- Corresponding_Equality Node13 -- Component_Clause Node13 -- Elaboration_Entity Node13 -- Extra_Accessibility Node13 @@ -232,7 +231,6 @@ package body Einfo is -- Overridden_Operation Node26 -- Package_Instantiation Node26 -- Relative_Deadline_Variable Node26 - -- Static_Initialization Node26 -- Current_Use_Clause Node27 -- Related_Type Node27 @@ -244,7 +242,8 @@ package body Einfo is -- Subprograms_For_Type Node29 - -- (unused) Node30 + -- Corresponding_Equality Node30 + -- Static_Initialization Node30 -- (unused) Node31 @@ -863,7 +862,7 @@ package body Einfo is (Ekind (Id) = E_Function and then not Comes_From_Source (Id) and then Chars (Id) = Name_Op_Ne); - return Node13 (Id); + return Node30 (Id); end Corresponding_Equality; function Corresponding_Protected_Entry (Id : E) return E is @@ -2862,7 +2861,7 @@ package body Einfo is begin pragma Assert (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id)); - return Node26 (Id); + return Node30 (Id); end Static_Initialization; function Stored_Constraint (Id : E) return L is @@ -3391,7 +3390,7 @@ package body Einfo is (Ekind (Id) = E_Function and then not Comes_From_Source (Id) and then Chars (Id) = Name_Op_Ne); - Set_Node13 (Id, V); + Set_Node30 (Id, V); end Set_Corresponding_Equality; procedure Set_Corresponding_Protected_Entry (Id : E; V : E) is @@ -5469,7 +5468,7 @@ package body Einfo is begin pragma Assert (Ekind (Id) = E_Procedure and then not Is_Dispatching_Operation (Id)); - Set_Node26 (Id, V); + Set_Node30 (Id, V); end Set_Static_Initialization; procedure Set_Stored_Constraint (Id : E; V : L) is @@ -8221,18 +8220,7 @@ package body Einfo is Write_Str ("Component_Clause"); when E_Function => - if not Comes_From_Source (Id) - and then - Chars (Id) = Name_Op_Ne - then - Write_Str ("Corresponding_Equality"); - - elsif Comes_From_Source (Id) then - Write_Str ("Elaboration_Entity"); - - else - Write_Str ("Field13??"); - end if; + Write_Str ("Elaboration_Entity"); when E_Procedure | E_Package | @@ -8879,13 +8867,7 @@ package body Einfo is when E_Procedure | E_Function => - if Ekind (Id) = E_Procedure - and then not Is_Dispatching_Operation (Id) - then - Write_Str ("Static_Initialization"); - else - Write_Str ("Overridden_Operation"); - end if; + Write_Str ("Overridden_Operation"); when others => Write_Str ("Field26??"); @@ -8942,6 +8924,10 @@ package body Einfo is end case; end Write_Field28_Name; + ------------------------ + -- Write_Field29_Name -- + ------------------------ + procedure Write_Field29_Name (Id : Entity_Id) is begin case Ekind (Id) is @@ -8953,6 +8939,84 @@ package body Einfo is end case; end Write_Field29_Name; + ------------------------ + -- Write_Field30_Name -- + ------------------------ + + procedure Write_Field30_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when E_Function => + Write_Str ("Corresponding_Equality"); + + when E_Procedure => + Write_Str ("Static_Initialization"); + + when others => + Write_Str ("Field30??"); + end case; + end Write_Field30_Name; + + ------------------------ + -- Write_Field31_Name -- + ------------------------ + + procedure Write_Field31_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when others => + Write_Str ("Field31??"); + end case; + end Write_Field31_Name; + + ------------------------ + -- Write_Field32_Name -- + ------------------------ + + procedure Write_Field32_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when others => + Write_Str ("Field32??"); + end case; + end Write_Field32_Name; + + ------------------------ + -- Write_Field33_Name -- + ------------------------ + + procedure Write_Field33_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when others => + Write_Str ("Field33??"); + end case; + end Write_Field33_Name; + + ------------------------ + -- Write_Field34_Name -- + ------------------------ + + procedure Write_Field34_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when others => + Write_Str ("Field34??"); + end case; + end Write_Field34_Name; + + ------------------------ + -- Write_Field35_Name -- + ------------------------ + + procedure Write_Field35_Name (Id : Entity_Id) is + begin + case Ekind (Id) is + when others => + Write_Str ("Field35??"); + end case; + end Write_Field35_Name; + ------------------------- -- Iterator Procedures -- ------------------------- diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 2f8e96dd18a..1266a3deb80 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -659,7 +659,7 @@ package Einfo is -- used to constrain a discriminant of the parent type. Points to the -- corresponding discriminant in the parent type. Otherwise it is Empty. --- Corresponding_Equality (Node13) +-- Corresponding_Equality (Node30) -- Defined in function entities for implicit inequality operators. -- Denotes the explicit or derived equality operation that creates -- the implicit inequality. Note that this field is not present in @@ -3746,7 +3746,7 @@ package Einfo is -- all types declared in the package, and that a warning must be emitted -- for those types to which static initialization is not available. --- Static_Initialization (Node26) +-- Static_Initialization (Node30) -- Defined in initialization procedures for types whose objects can be -- initialized statically. The value of this attribute is a positional -- aggregate whose components are compile-time static values. Used @@ -5310,8 +5310,7 @@ package Einfo is -- Handler_Records (List10) (non-generic case only) -- Protected_Body_Subprogram (Node11) -- Next_Inlined_Subprogram (Node12) - -- Corresponding_Equality (Node13) (implicit /= only) - -- Elaboration_Entity (Node13) (all other cases) + -- Elaboration_Entity (Node13) (not implicit /=) -- First_Optional_Parameter (Node14) (non-generic case only) -- DT_Position (Uint15) -- DTC_Entity (Node16) @@ -5331,6 +5330,7 @@ package Einfo is -- Wrapped_Entity (Node27) (non-generic case only) -- Extra_Formals (Node28) -- Subprograms_For_Type (Node29) + -- Corresponding_Equality (Node30) (implicit /= only) -- Body_Needed_For_SAL (Flag40) -- Elaboration_Entity_Required (Flag174) -- Default_Expressions_Processed (Flag108) @@ -5596,10 +5596,10 @@ package Einfo is -- Protection_Object (Node23) (for concurrent kind) -- Contract (Node24) -- Interface_Alias (Node25) - -- Static_Initialization (Node26) (init_proc only) -- Overridden_Operation (Node26) (never for init proc) -- Wrapped_Entity (Node27) (non-generic case only) -- Extra_Formals (Node28) + -- Static_Initialization (Node30) (init_proc only) -- Body_Needed_For_SAL (Flag40) -- Delay_Cleanups (Flag114) -- Discard_Names (Flag88) @@ -7357,6 +7357,12 @@ package Einfo is procedure Write_Field27_Name (Id : Entity_Id); procedure Write_Field28_Name (Id : Entity_Id); procedure Write_Field29_Name (Id : Entity_Id); + procedure Write_Field30_Name (Id : Entity_Id); + procedure Write_Field31_Name (Id : Entity_Id); + procedure Write_Field32_Name (Id : Entity_Id); + procedure Write_Field33_Name (Id : Entity_Id); + procedure Write_Field34_Name (Id : Entity_Id); + procedure Write_Field35_Name (Id : Entity_Id); -- These routines are used in Treepr to output a nice symbolic name for -- the given field, depending on the Ekind. No blanks or end of lines are -- output, just the characters of the field name. diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 87cd97d7fa6..b109b69e122 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -5523,7 +5523,9 @@ In addition to the above cases, warnings are also generated for GNAT features that have been provided in past versions but which have been superseded (typically by features in the new Ada standard). For example, @code{pragma Ravenscar} will be flagged since its -function is replaced by @code{pragma Profile(Ravenscar)}. +function is replaced by @code{pragma Profile(Ravenscar)}, and +@code{pragma Interface_Name} will be flagged since its function +is replaced by @code{pragma Import}. Note that this warning option functions differently from the restriction @code{No_Obsolescent_Features} in two respects. diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb index 2fa479cc980..ce690e567b4 100644 --- a/gcc/ada/gnatcmd.adb +++ b/gcc/ada/gnatcmd.adb @@ -2366,8 +2366,9 @@ begin then declare Path : constant String := - Absolute_Path - (Path_Name_Type (Variable.Value), Project); + Absolute_Path + (Path_Name_Type (Variable.Value), + Variable.Project); begin Add_To_Carg_Switches (new String'("-gnatec=" & Path)); @@ -2411,8 +2412,9 @@ begin then declare Path : constant String := - Absolute_Path - (Path_Name_Type (Variable.Value), Project); + Absolute_Path + (Path_Name_Type (Variable.Value), + Variable.Project); begin Add_To_Carg_Switches (new String'("-gnatec=" & Path)); diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb index 05fec4861e4..b575edaa105 100644 --- a/gcc/ada/prj-attr.adb +++ b/gcc/ada/prj-attr.adb @@ -265,6 +265,7 @@ package body Prj.Attr is "Ladefault_switches#" & "LcOleading_switches#" & "LcOswitches#" & + "LcOtrailing_switches#" & "LVlinker_options#" & "SVmap_file_option#" & diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index 4ce0a158662..757e0ee732b 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -332,6 +332,7 @@ package body Sem_Disp is elsif From_With_Type (Designated_Type (T)) and then Present (Non_Limited_View (Designated_Type (T))) + and then Scope (Designated_Type (T)) = Scope (Subp) then if Is_First_Subtype (Non_Limited_View (Designated_Type (T))) then Tagged_Type := Non_Limited_View (Designated_Type (T)); diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 2595b753ea6..8d8735596fe 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -11095,11 +11095,19 @@ package body Sem_Prag is Process_Import_Or_Interface; -- In Ada 2005, the permission to use Interface (a reserved word) - -- as a pragma name is considered an obsolescent feature. + -- as a pragma name is considered an obsolescent feature, and this + -- pragma was already obsolescent in Ada 95. - if Ada_Version >= Ada_2005 then + if Ada_Version >= Ada_95 then Check_Restriction (No_Obsolescent_Features, Pragma_Identifier (N)); + + if Warn_On_Obsolescent_Feature then + Error_Msg_N + ("pragma Interface is an obsolescent feature?j?", N); + Error_Msg_N + ("|use pragma Import instead?j?", N); + end if; end if; -------------------- @@ -11126,6 +11134,19 @@ package body Sem_Prag is Id := Get_Pragma_Arg (Arg1); Analyze (Id); + -- This is obsolete from Ada 95 on, but it is an implementation + -- defined pragma, so we do not consider that it violates the + -- restriction (No_Obsolescent_Features). + + if Ada_Version >= Ada_95 then + if Warn_On_Obsolescent_Feature then + Error_Msg_N + ("pragma Interface_Name is an obsolescent feature?j?", N); + Error_Msg_N + ("|use pragma Import instead?j?", N); + end if; + end if; + if not Is_Entity_Name (Id) then Error_Pragma_Arg ("first argument for pragma% must be entity name", Arg1); diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl index 4fbf0690c39..e84cce2385e 100644 --- a/gcc/ada/snames.ads-tmpl +++ b/gcc/ada/snames.ads-tmpl @@ -1343,6 +1343,7 @@ package Snames is Name_Toolchain_Description : constant Name_Id := N + $; Name_Toolchain_Version : constant Name_Id := N + $; Name_Trailing_Required_Switches : constant Name_Id := N + $; + Name_Trailing_Switches : constant Name_Id := N + $; Name_Runtime_Library_Dir : constant Name_Id := N + $; Name_Runtime_Source_Dir : constant Name_Id := N + $; diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index 0f61b04c291..64dbf2dd536 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -687,6 +687,54 @@ package body Treepr is Print_Eol; end if; + if Field_Present (Field30 (Ent)) then + Print_Str (Prefix); + Write_Field30_Name (Ent); + Write_Str (" = "); + Print_Field (Field30 (Ent)); + Print_Eol; + end if; + + if Field_Present (Field31 (Ent)) then + Print_Str (Prefix); + Write_Field31_Name (Ent); + Write_Str (" = "); + Print_Field (Field31 (Ent)); + Print_Eol; + end if; + + if Field_Present (Field32 (Ent)) then + Print_Str (Prefix); + Write_Field32_Name (Ent); + Write_Str (" = "); + Print_Field (Field32 (Ent)); + Print_Eol; + end if; + + if Field_Present (Field33 (Ent)) then + Print_Str (Prefix); + Write_Field33_Name (Ent); + Write_Str (" = "); + Print_Field (Field33 (Ent)); + Print_Eol; + end if; + + if Field_Present (Field34 (Ent)) then + Print_Str (Prefix); + Write_Field34_Name (Ent); + Write_Str (" = "); + Print_Field (Field34 (Ent)); + Print_Eol; + end if; + + if Field_Present (Field35 (Ent)) then + Print_Str (Prefix); + Write_Field35_Name (Ent); + Write_Str (" = "); + Print_Field (Field35 (Ent)); + Print_Eol; + end if; + Write_Entity_Flags (Ent, Prefix); end Print_Entity_Info; |