summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-19 08:31:55 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-19 08:31:55 +0000
commitd7ed83a2b5686530848aafcab09b5278684972b7 (patch)
treec350911e688b574ce53d0acc701833d4510f317e /gcc/ada/lib-xref.adb
parenta4cbfd6d78d0a33eca8d2c4da024e881d2d6d105 (diff)
downloadgcc-d7ed83a2b5686530848aafcab09b5278684972b7.tar.gz
2011-09-19 Robert Dewar <dewar@adacore.com>
* err_vars.ads, errout.ads: Minor reformatting. 2011-09-19 Robert Dewar <dewar@adacore.com> * aspects.ads (Impl_Defined_Aspects): New array * lib-writ.adb (No_Dependences): New name for No_Dependence * restrict.adb (No_Dependences): New name for No_Dependence (Check_Restriction_No_Specification_Of_Aspect): New procedure. (Set_Restriction_No_Specification_Of_Aspect): New procedure (Restricted_Profile_Result): New variable (No_Specification_Of_Aspects): New variable (No_Specification_Of_Aspect_Warning): New variable * restrict.ads (No_Dependences): New name for No_Dependence (Check_Restriction_No_Specification_Of_Aspect): New procedure (Set_Restriction_No_Specification_Of_Aspect): New procedure * s-rident.ads: Add restriction No_Implementation_Aspect_Specifications, this is also added to the No_Implementation_Extensions profile. * sem_ch13.adb (Analyze_Aspect_Specifications): Check No_Implementation_Defined_Aspects (Analyze_Aspect_Specifications): Check No_Specification_Of_Aspect * sem_prag.adb (Analyze_Aspect_Specifications): Check No_Implementation_Aspects (Analyze_Aspect_Specifications): Check No_Specification_Of_Aspect * snames.ads-tmpl (Name_No_Specification_Of_Aspect): New name 2011-09-19 Yannick Moy <moy@adacore.com> * lib-xref.adb (Generate_Reference): Take into account multiple renamings for Alfa refs. 2011-09-19 Thomas Quinot <quinot@adacore.com> * g-socthi-mingw.adb: Minor reformatting. 2011-09-19 Yannick Moy <moy@adacore.com> * gnat1drv.adb (Adjust_Global_Switches): Set tagged type expansion to False in mode Alfa 2011-09-19 Pascal Obry <obry@adacore.com> * mingw32.h: Remove obsolete code needed for old versions of MingW. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index e9de179f0c0..f50406f3d76 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -391,6 +391,10 @@ package body Lib.Xref is
Kind : Entity_Kind;
-- If Formal is non-Empty, then its Ekind, otherwise E_Void
+ function Get_Through_Renamings (E : Entity_Id) return Entity_Id;
+ -- Get the enclosing entity through renamings, which may come from
+ -- source or from the translation of generic instantiations.
+
function Is_On_LHS (Node : Node_Id) return Boolean;
-- Used to check if a node is on the left hand side of an assignment.
-- The following cases are handled:
@@ -412,6 +416,22 @@ package body Lib.Xref is
-- exceptions where we do not want to set this flag, see body for
-- details of these exceptional cases.
+ ---------------------------
+ -- Get_Through_Renamings --
+ ---------------------------
+
+ function Get_Through_Renamings (E : Entity_Id) return Entity_Id is
+ Result : Entity_Id := E;
+ begin
+ while Present (Result)
+ and then Is_Object (Result)
+ and then Present (Renamed_Object (Result))
+ loop
+ Result := Get_Enclosing_Object (Renamed_Object (Result));
+ end loop;
+ return Result;
+ end Get_Through_Renamings;
+
---------------
-- Is_On_LHS --
---------------
@@ -955,11 +975,8 @@ package body Lib.Xref is
-- the renaming, which is needed to compute a valid set of effects
-- (reads, writes) for the enclosing subprogram.
- if Alfa_Mode
- and then Is_Object (Ent)
- and then Present (Renamed_Object (Ent))
- then
- Ent := Get_Enclosing_Object (Renamed_Object (Ent));
+ if Alfa_Mode then
+ Ent := Get_Through_Renamings (Ent);
-- If no enclosing object, then it could be a reference to any
-- location not tracked individually, like heap-allocated data.