From 1299d82443d00011e17d65cfd593f8a8acae22cb Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 23 Jun 2010 06:50:13 +0000 Subject: 2010-06-23 Javier Miranda * atree.ads (Set_Reporting_Proc): New subprogram. * atree.adb: Remove dependency on packages Opt and SCIL_LL. (Allocate_Initialize_Node, Replace, Rewrite): Replace direct calls to routines of package Scil_ll by indirect call to the registered subprogram. (Set_Reporting_Proc): New subprogram. Used to register a subprogram that is invoked when a node is allocated, replaced or rewritten. * scil_ll.adb (Copy_SCIL_Node): New routine that takes care of copying the SCIL node. Used as argument for Set_Reporting_Proc. (Initialize): Register Copy_SCIL_Node as the reporting routine that is invoked by atree. 2010-06-23 Thomas Quinot * sem_ch3.ads: Minor reformatting. 2010-06-23 Ed Schonberg * sem_ch12.adb (Analyze_Package_Instantiation): In CodePeer mode, always analyze the generic body and instance, because it may be needed downstream. (Mark_Context): Prepend the with clauses for needed generic units, so they appear in a better order for CodePeer. * sem_util.adb, sem_util.ads: Prototype code for AI05-0144. 2010-06-23 Emmanuel Briot * prj.ads, prj-nmsc.adb (Error_Or_Warning): New subprogram. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161252 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/atree.adb | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'gcc/ada/atree.adb') diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb index c0c5bd8dde9..807527230af 100644 --- a/gcc/ada/atree.adb +++ b/gcc/ada/atree.adb @@ -38,14 +38,15 @@ pragma Style_Checks (All_Checks); with Debug; use Debug; with Nlists; use Nlists; -with Opt; use Opt; with Output; use Output; with Sinput; use Sinput; -with SCIL_LL; use SCIL_LL; with Tree_IO; use Tree_IO; package body Atree is + Reporting_Proc : Report_Proc := null; + -- Record argument to last call to Set_Reporting_Proc + --------------- -- Debugging -- --------------- @@ -534,10 +535,10 @@ package body Atree is Orig_Nodes.Set_Last (Nodes.Last); Allocate_List_Tables (Nodes.Last); - -- Update the SCIL_Node field (if available) + -- Invoke the reporting procedure (if available) - if Generate_SCIL then - Set_SCIL_Node (New_Id, Get_SCIL_Node (Src)); + if Reporting_Proc /= null then + Reporting_Proc.all (Target => New_Id, Source => Src); end if; return New_Id; @@ -925,6 +926,16 @@ package body Atree is return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6); end Ekind_In; + ------------------------ + -- Set_Reporting_Proc -- + ------------------------ + + procedure Set_Reporting_Proc (P : Report_Proc) is + begin + pragma Assert (Reporting_Proc = null); + Reporting_Proc := P; + end Set_Reporting_Proc; + ------------------ -- Error_Posted -- ------------------ @@ -1580,10 +1591,10 @@ package body Atree is Orig_Nodes.Table (Old_Node) := Old_Node; - -- Update the SCIL_Node field (if available) + -- Invoke the reporting procedure (if available) - if Generate_SCIL then - Set_SCIL_Node (Old_Node, Get_SCIL_Node (New_Node)); + if Reporting_Proc /= null then + Reporting_Proc.all (Target => Old_Node, Source => New_Node); end if; end Replace; @@ -1644,10 +1655,10 @@ package body Atree is Fix_Parents (Ref_Node => New_Node, Fix_Node => Old_Node); - -- Update the SCIL_Node field (if available) + -- Invoke the reporting procedure (if available) - if Generate_SCIL then - Set_SCIL_Node (Old_Node, Get_SCIL_Node (New_Node)); + if Reporting_Proc /= null then + Reporting_Proc.all (Target => Old_Node, Source => New_Node); end if; end Rewrite; -- cgit v1.2.1