diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-04-26 11:59:24 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2012-04-26 11:59:24 +0200 |
commit | f146302c2594902c5584bdf9ea25c57979e4cb1c (patch) | |
tree | e1b32d8e1671c72e0a4bafe5df74c859a9f1e2b0 /gcc/ada/exp_ch2.adb | |
parent | 7a6de2e28f76b03283097d1f2c36511cd7fe7dcc (diff) | |
download | gcc-f146302c2594902c5584bdf9ea25c57979e4cb1c.zip gcc-f146302c2594902c5584bdf9ea25c57979e4cb1c.tar.gz gcc-f146302c2594902c5584bdf9ea25c57979e4cb1c.tar.bz2 |
[multiple changes]
2012-04-26 Robert Dewar <dewar@adacore.com>
* sem_ch5.adb (Check_Unreachable_Code): Skip past pragmas.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* s-finroo.ads: Remove with clause for
Ada.Streams. Type Root_Controlled is now abstract tagged null
record. Remove internal package Stream_Attributes. Root_Controlled
doesn't need stream attribute redeclaration and avoids the
dependency on streams.
2012-04-26 Tristan Gingold <gingold@adacore.com>
* adaint.c (to_host_path_spec): Removed (unused).
Minor reformatting.
2012-04-26 Steve Baird <baird@adacore.com>
* gnat_rm.texi Improve description of Valid_Scalars attribute.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Can_Override_Operator): If the formal is a
generic type the operator cannot be overriding.
2012-04-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Spec_Reloaded_For_Body): Check whether the type
is declared in a package specification, and current unit is the
corresponding package body. The use clauses themselves may be
within a nested package.
2012-04-26 Bob Duff <duff@adacore.com>
* exp_ch2.adb (Param_Entity): Take into account the case where
the type of the entry parameter has a representation clause.
From-SVN: r186870
Diffstat (limited to 'gcc/ada/exp_ch2.adb')
-rw-r--r-- | gcc/ada/exp_ch2.adb | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index 80f381b..2f19d20 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- 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- -- @@ -723,6 +723,8 @@ package body Exp_Ch2 is -- typ!(recobj).rec.all'Constrained -- where rec is a selector whose Entry_Formal link points to the formal + -- If the type of the entry parameter has a representation clause, then an + -- extra temp is involved (see below). -- For a formal of a task entity, the formal is rewritten as a local -- renaming. @@ -760,10 +762,30 @@ package body Exp_Ch2 is else if Nkind (N) = N_Explicit_Dereference then declare - P : constant Node_Id := Prefix (N); - S : Node_Id; + P : Node_Id := Prefix (N); + S : Node_Id; + E : Entity_Id; + Decl : Node_Id; begin + -- If the type of an entry parameter has a representation + -- clause, then the prefix is not a selected component, but + -- instead a reference to a temp pointing at the selected + -- component. In this case, set P to be the initial value of + -- that temp. + + if Nkind (P) = N_Identifier then + E := Entity (P); + + if Ekind (E) = E_Constant then + Decl := Parent (E); + + if Nkind (Decl) = N_Object_Declaration then + P := Expression (Decl); + end if; + end if; + end if; + if Nkind (P) = N_Selected_Component then S := Selector_Name (P); |