diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 475fc118e30..a28897f750d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,32 @@ +2011-08-03 Javier Miranda + + * exp_util.adb, sem_aux.adb, exp_util.ads, sem_aux.ads: + Move routine Is_VM_By_Copy_Actual from sem_aux to exp_util. + +2011-08-03 Bob Duff + + * sem_ch8.adb (Is_Primitive_Operator_In_Use): Always check In_Use on + the Base_Type. + +2011-08-03 Joel Brobecker + + * g-sha256.ads, g-sha512.ads, g-sha1.ads, g-sha224.ads, g-sha384.ads, + g-sehash.ads: Fix typo. Update header. + +2011-08-03 Thomas Quinot + + * exp_ch6.adb (Expand_Actuals): Remove Ada_2005 guard on build-in-place + expansion. + +2011-08-03 Gary Dismukes + + * sem_ch4.adb (Analyze_Overloaded_Selected_Component): Consider + prefixes of private types along with records, since the selector may be + a discriminant. + * sem_res.adb (Resolve_Selected_Component): Consider prefixes of + private types along with records, since the selector may be a + discriminant. + 2011-08-03 Emmanuel Briot * prj-pp.adb (Pretty_Print): remove trailing blank line in the file diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index bf7b44ec68d..d09261eae85 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -1472,9 +1472,7 @@ package body Exp_Ch6 is -- functions that are treated as build-in-place to include other -- composite result types. - if Ada_Version >= Ada_2005 - and then Is_Build_In_Place_Function_Call (Actual) - then + if Is_Build_In_Place_Function_Call (Actual) then Make_Build_In_Place_Call_In_Anonymous_Context (Actual); end if; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 9a5eef05b6e..9220837ed9b 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, 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- -- @@ -3561,6 +3561,18 @@ package body Exp_Util is end if; end Is_Volatile_Reference; + -------------------------- + -- Is_VM_By_Copy_Actual -- + -------------------------- + + function Is_VM_By_Copy_Actual (N : Node_Id) return Boolean is + begin + return VM_Target /= No_VM + and then Nkind (N) = N_Identifier + and then Present (Renamed_Object (Entity (N))) + and then Nkind (Renamed_Object (Entity (N))) = N_Slice; + end Is_VM_By_Copy_Actual; + -------------------- -- Kill_Dead_Code -- -------------------- diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 5ef792b85aa..4f13fa96f88 100644 --- a/gcc/ada/exp_util.ads +++ b/gcc/ada/exp_util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2011, 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- -- @@ -537,6 +537,10 @@ package Exp_Util is -- or has Volatile_Components set. A slice of a volatile variable is -- also volatile. + function Is_VM_By_Copy_Actual (N : Node_Id) return Boolean; + -- Returns True if we are compiling on VM targets and N is a node that + -- requires to be passed by copy in these targets. + procedure Kill_Dead_Code (N : Node_Id; Warn : Boolean := False); -- N represents a node for a section of code that is known to be dead. Any -- exception handler references and warning messages relating to this code diff --git a/gcc/ada/g-sehash.ads b/gcc/ada/g-sehash.ads index 898f2adfa5b..c3bbce1edb4 100644 --- a/gcc/ada/g-sehash.ads +++ b/gcc/ada/g-sehash.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2002-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2002-2011, 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- -- diff --git a/gcc/ada/g-sha1.ads b/gcc/ada/g-sha1.ads index c02589e2354..2a1c0e1dc60 100644 --- a/gcc/ada/g-sha1.ads +++ b/gcc/ada/g-sha1.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2009-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2011, 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- -- diff --git a/gcc/ada/g-sha224.ads b/gcc/ada/g-sha224.ads index 4b81112bbdb..0520a5efe31 100644 --- a/gcc/ada/g-sha224.ads +++ b/gcc/ada/g-sha224.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2011, 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- -- diff --git a/gcc/ada/g-sha256.ads b/gcc/ada/g-sha256.ads index a638ff974ef..91088433c00 100644 --- a/gcc/ada/g-sha256.ads +++ b/gcc/ada/g-sha256.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2011, 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- -- diff --git a/gcc/ada/g-sha384.ads b/gcc/ada/g-sha384.ads index 7a63d7e6ef2..0047da06ca3 100644 --- a/gcc/ada/g-sha384.ads +++ b/gcc/ada/g-sha384.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2011, 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- -- diff --git a/gcc/ada/g-sha512.ads b/gcc/ada/g-sha512.ads index 331db7d3469..e75d9493d45 100644 --- a/gcc/ada/g-sha512.ads +++ b/gcc/ada/g-sha512.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2009-2011, 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- -- diff --git a/gcc/ada/sem_aux.adb b/gcc/ada/sem_aux.adb index fd78fbf2cd8..0e5c3db3cf0 100755 --- a/gcc/ada/sem_aux.adb +++ b/gcc/ada/sem_aux.adb @@ -36,7 +36,6 @@ with Namet; use Namet; with Sinfo; use Sinfo; with Snames; use Snames; with Stand; use Stand; -with Targparm; use Targparm; package body Sem_Aux is @@ -785,18 +784,6 @@ package body Sem_Aux is end if; end Is_Limited_Type; - -------------------------- - -- Is_VM_By_Copy_Actual -- - -------------------------- - - function Is_VM_By_Copy_Actual (N : Node_Id) return Boolean is - begin - return VM_Target /= No_VM - and then Nkind (N) = N_Identifier - and then Present (Renamed_Object (Entity (N))) - and then Nkind (Renamed_Object (Entity (N))) = N_Slice; - end Is_VM_By_Copy_Actual; - ---------------------- -- Nearest_Ancestor -- ---------------------- diff --git a/gcc/ada/sem_aux.ads b/gcc/ada/sem_aux.ads index acf37e6450b..cf9af2e7178 100755 --- a/gcc/ada/sem_aux.ads +++ b/gcc/ada/sem_aux.ads @@ -186,10 +186,6 @@ package Sem_Aux is -- composite containing a limited component, or a subtype of any of -- these types). - function Is_VM_By_Copy_Actual (N : Node_Id) return Boolean; - -- Returns True if we are compiling on VM targets and N is a node that - -- requires to be passed by copy in these targets. - function Nearest_Ancestor (Typ : Entity_Id) return Entity_Id; -- Given a subtype Typ, this function finds out the nearest ancestor from -- which constraints and predicates are inherited. There is no simple link diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 912e09b643d..664a080ee3b 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -3127,7 +3127,10 @@ package body Sem_Ch4 is T := It.Typ; end if; - if Is_Record_Type (T) then + -- Locate the component. For a private prefix the selector can denote + -- a discriminant. + + if Is_Record_Type (T) or else Is_Private_Type (T) then -- If the prefix is a class-wide type, the visible components are -- those of the base type. diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index e0e1e06ef1c..d02e9118a97 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3639,11 +3639,9 @@ package body Sem_Ch8 is (Op : Entity_Id; F : Entity_Id) return Boolean is - T : constant Entity_Id := Etype (F); + T : constant Entity_Id := Base_Type (Etype (F)); begin - return (In_Use (T) - or else Present (Current_Use_Clause (Base_Type (T)))) - and then Scope (T) = Scope (Op); + return In_Use (T) and then Scope (T) = Scope (Op); end Is_Primitive_Operator_In_Use; -- Start of processing for End_Use_Package diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index a5e229195f8..e88e551cb2e 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8378,7 +8378,10 @@ package body Sem_Res is T := It.Typ; end if; - if Is_Record_Type (T) then + -- Locate selected component. For a private prefix the selector + -- can denote a discriminant. + + if Is_Record_Type (T) or else Is_Private_Type (T) then -- The visible components of a class-wide type are those of -- the root type.