aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-19 10:21:37 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-19 10:21:37 +0200
commit99ba07a3b0337454acc00e0a0bcf57ec9df73e80 (patch)
tree77741937fcacc762f9c11b5287338ae96d11b444 /gcc/ada/lib-xref.adb
parent96b25c42a67dbfe1df14abb224e3f6f040ca961c (diff)
downloadgcc-99ba07a3b0337454acc00e0a0bcf57ec9df73e80.zip
gcc-99ba07a3b0337454acc00e0a0bcf57ec9df73e80.tar.gz
gcc-99ba07a3b0337454acc00e0a0bcf57ec9df73e80.tar.bz2
[multiple changes]
2011-09-19 Robert Dewar <dewar@adacore.com> * sem_aggr.adb, lib-writ.ads, s-restri.ads, sem_ch6.adb, exp_aggr.adb: Minor reformatting. 2011-09-19 Yannick Moy <moy@adacore.com> * lib-xref.adb (Generate_Reference): Change entity referenced to underlying object if any, or else reference to the HEAP. From-SVN: r178956
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r--gcc/ada/lib-xref.adb27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb
index f16e8ab..e9de179 100644
--- a/gcc/ada/lib-xref.adb
+++ b/gcc/ada/lib-xref.adb
@@ -951,6 +951,33 @@ package body Lib.Xref is
return;
end if;
+ -- In Alfa mode, consider the underlying entity renamed instead of
+ -- 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 no enclosing object, then it could be a reference to any
+ -- location not tracked individually, like heap-allocated data.
+ -- Conservatively approximate this possibility by generating a
+ -- dereference, and return.
+
+ if No (Ent) then
+ if Actual_Typ = 'w' then
+ Alfa.Generate_Dereference (Nod, 'r');
+ Alfa.Generate_Dereference (Nod, 'w');
+ else
+ Alfa.Generate_Dereference (Nod, 'r');
+ end if;
+
+ return;
+ end if;
+ end if;
+
-- Record reference to entity
Ref := Original_Location (Sloc (Nod));