From: Arnaud Charlet Date: Wed, 25 Apr 2012 15:12:34 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d024b1268cedd1e5720d9f6968bef11d8a159c15;p=gcc.git [multiple changes] 2012-04-25 Vincent Celier * sem_ch12.adb (Inherit_Context): Compare library units, not names of units, when checking if a unit is already in the context. 2012-04-25 Thomas Quinot * sem_ch3.adb: Reverse_Storage_Order must be propagated to untagged derived record types. 2012-04-25 Ed Schonberg * lib-xref.adb: Adjust position of end label. From-SVN: r186827 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 34144913fd9..44f206cbbd4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2012-04-25 Vincent Celier + + * sem_ch12.adb (Inherit_Context): Compare library units, not + names of units, when checking if a unit is already in the context. + +2012-04-25 Thomas Quinot + + * sem_ch3.adb: Reverse_Storage_Order must be propagated to + untagged derived record types. + +2012-04-25 Ed Schonberg + + * lib-xref.adb: Adjust position of end label. + 2012-04-22 Jan Hubicka * gcc-interface/utils.c (gnat_write_global_declarations): Do not mark diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index b6595b336a4..fb46a367e62 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -1031,10 +1031,14 @@ package body Lib.Xref is Ref := Original_Location (Sloc (Nod)); Def := Original_Location (Sloc (Ent)); - -- If this is an operator symbol, skip the initial - -- quote, for navigation purposes. + -- If this is an operator symbol, skip the initial quote for + -- navigation purposes. This is not done for the end label, + -- where we want the actual position after the closing quote. - if Nkind (N) = N_Defining_Operator_Symbol + if Typ = 't' then + null; + + elsif Nkind (N) = N_Defining_Operator_Symbol or else Nkind (Nod) = N_Operator_Symbol then Ref := Ref + 1; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d0525633681..a5360d4ac5f 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -7761,8 +7761,9 @@ package body Sem_Ch12 is Item : Node_Id; New_I : Node_Id; - Clause : Node_Id; - OK : Boolean; + Clause : Node_Id; + OK : Boolean; + Lib_Unit : Node_Id; begin if Nkind (Parent (Gen_Decl)) = N_Compilation_Unit then @@ -7784,17 +7785,18 @@ package body Sem_Ch12 is Item := First (Context_Items (Parent (Gen_Decl))); while Present (Item) loop if Nkind (Item) = N_With_Clause then + Lib_Unit := Library_Unit (Item); - -- Take care to prevent direct cyclic with's. + -- Take care to prevent direct cyclic with's - if Library_Unit (Item) /= Current_Unit then + if Lib_Unit /= Current_Unit then -- Do not add a unit if it is already in the context Clause := First (Current_Context); OK := True; while Present (Clause) loop if Nkind (Clause) = N_With_Clause and then - Chars (Name (Clause)) = Chars (Name (Item)) + Library_Unit (Clause) = Lib_Unit then OK := False; exit; diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 3e10ac36dc8..f80804d7cf9 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -7753,21 +7753,26 @@ package body Sem_Ch3 is if Is_Record_Type (Derived_Type) then - -- Ekind (Parent_Base) is not necessarily E_Record_Type since - -- Parent_Base can be a private type or private extension. + declare + Parent_Full : Entity_Id; + begin + -- Ekind (Parent_Base) is not necessarily E_Record_Type since + -- Parent_Base can be a private type or private extension. Go + -- to the full view here to get the E_Record_Type specific flags. + + if Present (Full_View (Parent_Base)) then + Parent_Full := Full_View (Parent_Base); + else + Parent_Full := Parent_Base; + end if; - if Present (Full_View (Parent_Base)) then - Set_OK_To_Reorder_Components - (Derived_Type, - OK_To_Reorder_Components (Full_View (Parent_Base))); - Set_Reverse_Bit_Order - (Derived_Type, Reverse_Bit_Order (Full_View (Parent_Base))); - else Set_OK_To_Reorder_Components - (Derived_Type, OK_To_Reorder_Components (Parent_Base)); + (Derived_Type, OK_To_Reorder_Components (Parent_Full)); Set_Reverse_Bit_Order - (Derived_Type, Reverse_Bit_Order (Parent_Base)); - end if; + (Derived_Type, Reverse_Bit_Order (Parent_Full)); + Set_Reverse_Storage_Order + (Derived_Type, Reverse_Storage_Order (Parent_Full)); + end; end if; -- Direct controlled types do not inherit Finalize_Storage_Only flag