summaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2013-04-19 06:23:16 -0500
committerAldy Hernandez <aldyh@redhat.com>2013-04-19 06:23:16 -0500
commitcd7cb45fc78ae9a62968372eae37da08444da8ca (patch)
tree034e6313862f8ff73c460181d06785834ef5f25a /gcc/ada/lib-xref.adb
parente2d763ab505e4e070c7661d2373c2c9b43f45cb1 (diff)
parent52108848ca6e017bc3ca0efeef67a450d7e32e56 (diff)
downloadgcc-cd7cb45fc78ae9a62968372eae37da08444da8ca.tar.gz
Merge remote-tracking branch 'origin/cilkplus' into cilkplus-simd-rewrite
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb35
1 files changed, 26 insertions, 9 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index 2f01dd4480f..ba9221b2bd4 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2013, 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- --
@@ -516,11 +516,9 @@ package body Lib.Xref is
P := Parent (P);
if Nkind (P) = N_Pragma then
- if Pragma_Name (P) = Name_Warnings
- or else
- Pragma_Name (P) = Name_Unmodified
- or else
- Pragma_Name (P) = Name_Unreferenced
+ if Nam_In (Pragma_Name (P), Name_Warnings,
+ Name_Unmodified,
+ Name_Unreferenced)
then
return False;
end if;
@@ -1364,6 +1362,23 @@ package body Lib.Xref is
then
Tref := Etype (Tref);
+ -- Another special case: an object of a classwide type
+ -- initialized with a tag-indeterminate call gets a subtype
+ -- of the classwide type during expansion. See if the original
+ -- type in the declaration is named, and return it instead
+ -- of going to the root type.
+
+ if Ekind (Tref) = E_Class_Wide_Subtype
+ and then Nkind (Parent (Ent)) = N_Object_Declaration
+ and then
+ Nkind (Original_Node (Object_Definition (Parent (Ent))))
+ = N_Identifier
+ then
+ Tref :=
+ Entity
+ (Original_Node ((Object_Definition (Parent (Ent)))));
+ end if;
+
-- For anything else, exit
else
@@ -2047,8 +2062,8 @@ package body Lib.Xref is
Ctyp := '*';
end if;
- -- Special handling for access parameters and objects of
- -- an anonymous access type.
+ -- Special handling for access parameters and objects and
+ -- components of an anonymous access type.
if Ekind_In (Etype (XE.Key.Ent),
E_Anonymous_Access_Type,
@@ -2056,7 +2071,9 @@ package body Lib.Xref is
E_Anonymous_Access_Protected_Subprogram_Type)
then
if Is_Formal (XE.Key.Ent)
- or else Ekind_In (XE.Key.Ent, E_Variable, E_Constant)
+ or else
+ Ekind_In
+ (XE.Key.Ent, E_Variable, E_Constant, E_Component)
then
Ctyp := 'p';
end if;