aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-31 16:39:17 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-31 16:39:17 +0100
commita54ffd6cb9056b98ec4f188122b370e29ddd30d0 (patch)
treecf41dba58aade03b495fc9aee9e400ce1e93476c /gcc/ada/lib-xref.ads
parent408249b2e2bc8ddc31d9041c31c3782392b54c3f (diff)
downloadgcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.zip
gcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.tar.gz
gcc-a54ffd6cb9056b98ec4f188122b370e29ddd30d0.tar.bz2
[multiple changes]
2014-01-31 Robert Dewar <dewar@adacore.com> * sem_ch4.adb: Minor reformatting. 2014-01-31 Robert Dewar <dewar@adacore.com> * exp_ch2.adb: New calling sequence for Is_LHS. * frontend.adb: Add call to Process_Deferred_References. * lib-xref.ads, lib-xref.adb (Process_Deferred_References): New. (Deferred_References): New table. * sem_ch8.adb (Find_Direct_Name): Make deferred reference table entries. (Find_Expanded_Name): Ditto. * sem_res.adb: New calling sequence for Is_LHS. * sem_util.ads, sem_util.adb (Is_LHS): New calling sequence. * sem_warn.adb: Call Process_Deferred_References before issuing warnings. 2014-01-31 Tristan Gingold <gingold@adacore.com> * exp_util.adb (Corresponding_Runtime_Package): Restrict the use of System_Tasking_Protected_Objects_Single_Entry. * exp_ch9.adb (Build_Simple_Entry_Call): Remove Mode parameter of Protected_Single_Entry_Call. (Expand_N_Timed_Entry_Call): Remove single_entry case. * exp_disp.adb (Make_Disp_Asynchronous_Select_Body): Remove single_entry case. (Make_Disp_Timed_Select_Body): Likewise. * rtsfind.ads (RE_Timed_Protected_Single_Entry_Call): Remove. * s-tposen.adb (Send_Program_Error, PO_Do_Or_Queue): Remove Self_Id parameter. (Wakeup_Entry_Caller): Remove Self_ID and New_State parameters. (Wait_For_Completion_With_Timeout): Remove. (Protected_Single_Entry_Call): Remove Mode parameter (always Simple_Call). (Service_Entry): Remove Self_Id constant (not used anymore). (Timed_Protected_Single_Entry_Call): Remove. * s-tposen.ads (Timed_Protected_Single_Entry_Call): Remove. (Protected_Single_Entry_Call): Remove Mode parameter. From-SVN: r207349
Diffstat (limited to 'gcc/ada/lib-xref.ads')
-rw-r--r--gcc/ada/lib-xref.ads33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads
index a0d5370..b8f3e55 100644
--- a/gcc/ada/lib-xref.ads
+++ b/gcc/ada/lib-xref.ads
@@ -600,6 +600,39 @@ package Lib.Xref is
-- Export at line 4, that its body is exported to C, and that the link name
-- as given in the pragma is "here".
+ -------------------------
+ -- Deferred_References --
+ -------------------------
+
+ -- Normally we generate references as we go along, but as discussed in
+ -- Sem_Util.Is_LHS, and Sem_Ch8.Find_Direct_Name/Find_Selected_Component,
+ -- we have one case where that is tricky, which is when we have something
+ -- like X.A := 3, where we don't know until we know the type of X whether
+ -- this is a reference (if X is an access type, so what we really have is
+ -- X.all.A := 3) or a modification, where X is not an access type.
+
+ -- What we do in such cases is to gather nodes, where we would have liked
+ -- to call Generate_Reference but we couldn't because we didn't know enough
+ -- into this table, Then we deal with generating references later on when
+ -- we have sufficient information to do it right.
+
+ type Deferred_Reference_Entry is record
+ E : Entity_Id;
+ N : Node_Id;
+ end record;
+ -- One entry, E, N are as required for Generate_Reference call
+
+ package Deferred_References is new Table.Table (
+ Table_Component_Type => Deferred_Reference_Entry,
+ Table_Index_Type => Int,
+ Table_Low_Bound => 0,
+ Table_Initial => 512,
+ Table_Increment => 200,
+ Table_Name => "Name_Deferred_References");
+
+ procedure Process_Deferred_References;
+ -- This procedure is called from Frontend to process these table entries.
+
-----------------------------
-- SPARK Xrefs Information --
-----------------------------