summaryrefslogtreecommitdiff
path: root/gcc/ada/atree.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 18:16:03 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 18:16:03 +0000
commit560edc4abacc494bd98af69035fec869e436a5c8 (patch)
tree3f325a73eb43505d6e56c239974922ae3bc57bb9 /gcc/ada/atree.adb
parent29a753913cdef01ec6d8100eb0cea4933da9f21a (diff)
downloadgcc-560edc4abacc494bd98af69035fec869e436a5c8.tar.gz
2006-10-31 Robert Dewar <dewar@adacore.com>
Thomas Quinot <quinot@adacore.com> Arnaud Charlet <charlet@adacore.com> * fmap.adb: Put routines in alpha order * g-boumai.ads: Remove redundant 'in' keywords * g-cgi.adb: Minor reformatting * g-cgi.ads: Remove redundant 'in' keywords * get_targ.adb: Put routines in alpha order * prj-attr.ads: Minor reformatting * s-atacco.ads: Minor reformatting * scn.adb: Put routines in alpha order * sinput-l.adb: Minor comment fix * sinput-p.adb: Minor comment fix * s-maccod.ads: Minor reformatting * s-memory.adb: Minor reformatting * s-htable.adb: Fix typo in comment. * s-secsta.adb: Minor comment update. * s-soflin.adb: Minor reformatting * s-stoele.ads: Add comment about odd qualification in Storage_Offset declaration * s-strxdr.adb: Remove unnecessary 'in' keywords for formal parameters. * treeprs.adt: Minor reformatting * urealp.adb: Put routines in alpha order * s-wchcon.ads, s-wchcon.adb (Get_WC_Encoding_Method): New version taking string. * s-asthan-vms-alpha.adb: Remove redundant 'in' keywords * g-trasym-vms-ia64.adb: Remove redundant 'in' keywords * env.c (__gnat_unsetenv): Unsetenv is unavailable on LynxOS, so workaround as on other platforms. * g-eacodu-vms.adb: Remove redundant 'in' keywords * g-expect-vms.adb: Remove redundant 'in' keywords * gnatdll.adb (Add_Files_From_List): Handle Name_Error and report a clear error message if the list-of-files file cannot be opened. * g-thread.adb (Unregister_Thread_Id): Add use type Thread_Id so the equality operator is always visible. * lang.opt: Woverlength-strings: New option. * nmake.adt: Update copyright, since nmake.ads and nmake.adb have changed. * osint-b.ads, osint-b.adb (Time_From_Last_Bind): removed function . (Binder_Output_Time_Stamps_Set): removed. (Old_Binder_Output_Time_Stamp): idem. (New_Binder_Output_Time_Stamp): idem. (Recording_Time_From_Last_Bind): idem. (Recording_Time_From_Last_Bind): Make constant. * output.ads, output.adb (Write_Str): Allow LF characters (Write_Spaces): New procedure * prepcomp.adb (Preproc_Data_Table): Change Increment from 5% to 100% * inline.adb: Minor reformatting * s-asthan-vms-alpha.adb: Remove redundant 'in' keywords * s-mastop-vms.adb: Remove redundant 'in' keywords * s-osprim-vms.adb: Remove redundant 'in' keywords * s-trafor-default.adb: Remove redundant 'in' keywords * 9drpc.adb: Remove redundant 'in' keywords * s-osinte-mingw.ads: Minor reformatting * s-inmaop-posix.adb: Minor reformatting * a-direio.ads: Remove quotes from Compile_Time_Warning message * a-exexda.adb: Minor code reorganization * a-filico.adb: Minor reformatting * a-finali.adb: Minor reformatting * a-nudira.ads: Remove quote from Compile_Time_Warning message * a-numeri.ads: Minor reformatting * a-sequio.ads: Remove quotes from Compile_Time_Warning message * exp_pakd.ads: Fix obsolete comment * a-ztenau.adb, a-ztenio.adb, a-wtenau.adb, a-tienau.adb, a-wtenio.adb (Put): Avoid assuming low bound of string is 1. Probably not a bug, but certainly neater and more efficient. * a-tienio.adb: Minor reformatting * comperr.adb (Compiler_Abort): Call Cancel_Special_Output at start Avoid assuming low bound of string is 1. * gnatbind.adb: Change Bindusg to package and rename procedure as Display, which now ensures that it only outputs usage information once. (Scan_Bind_Arg): Avoid assuming low bound of string is 1. * g-pehage.adb (Build_Identical_Keysets): Replace use of 1 by Table'First. * g-regpat.adb (Insert_Operator): Add pragma Warnings (Off) to kill warning. (Match): Add pragma Assert to ensure that Matches'First is zero * g-regpat.ads (Match): Document that Matches lower bound must be zero * makeutl.adb (Is_External_Assignment): Add pragma Assert's to check documented preconditions (also kills warnings about bad indexes). * mdll.adb (Build_Dynamic_Library): Avoid assumption that Afiles'First is 1. (Build_Import_Library): Ditto; * mdll-utl.adb: (Gnatbind): Avoid assumption that Alis'First = 1 * rtsfind.adb (RTE_Error_Msg): Avoid assuming low bound of string is 1. * sem_case.adb (Analyze_Choices): Add pragma Assert to check that lower bound of choice table is 1. * sem_case.ads (Analyze_Choices): Document that lower bound of Choice_Table is 1. * s-imgdec.adb (Set_Decimal_Digits): Avoid assuming low bound of string is 1. * uintp.adb (Init_Operand): Document that low bound of Vec is always 1, and add appropriate Assert pragma to suppress warnings. * atree.h, atree.ads, atree.adb Change Elist24 to Elist25 Add definitions of Field28 and Node28 (Traverse_Field): Use new syntactic parent table in sinfo. * cstand.adb: Change name Is_Ada_2005 to Is_Ada_2005_Only * itypes.adb: Change name Is_Ada_2005 to Is_Ada_2005_Only * exp_tss.adb: Put routines in alpha order * fe.h: Remove redundant declarations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118330 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/atree.adb')
-rw-r--r--gcc/ada/atree.adb90
1 files changed, 57 insertions, 33 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index 119cf62d080..1cdf5aeec55 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, 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- --
@@ -2360,17 +2360,24 @@ package body Atree is
function Traverse_Func (Node : Node_Id) return Traverse_Result is
- function Traverse_Field (Fld : Union_Id) return Traverse_Result;
- -- Fld is one of the fields of Node. If the field points to a
- -- syntactic node or list, then this node or list is traversed,
- -- and the result is the result of this traversal. Otherwise
- -- a value of True is returned with no processing.
+ function Traverse_Field
+ (Nod : Node_Id;
+ Fld : Union_Id;
+ FN : Field_Num) return Traverse_Result;
+ -- Fld is one of the fields of Nod. If the field points to syntactic
+ -- node or list, then this node or list is traversed, and the result is
+ -- the result of this traversal. Otherwise a value of True is returned
+ -- with no processing. FN is the number of the field (1 .. 5).
--------------------
-- Traverse_Field --
--------------------
- function Traverse_Field (Fld : Union_Id) return Traverse_Result is
+ function Traverse_Field
+ (Nod : Node_Id;
+ Fld : Union_Id;
+ FN : Field_Num) return Traverse_Result
+ is
begin
if Fld = Union_Id (Empty) then
return OK;
@@ -2381,9 +2388,7 @@ package body Atree is
-- Traverse descendent that is syntactic subtree node
- if Parent (Node_Id (Fld)) = Node
- or else Original_Node (Parent (Node_Id (Fld))) = Node
- then
+ if Is_Syntactic_Field (Nkind (Nod), FN) then
return Traverse_Func (Node_Id (Fld));
-- Node that is not a syntactic subtree
@@ -2398,9 +2403,7 @@ package body Atree is
-- Traverse descendent that is a syntactic subtree list
- if Parent (List_Id (Fld)) = Node
- or else Original_Node (Parent (List_Id (Fld))) = Node
- then
+ if Is_Syntactic_Field (Nkind (Nod), FN) then
declare
Elmt : Node_Id := First (List_Id (Fld));
begin
@@ -2439,39 +2442,36 @@ package body Atree is
return OK;
when OK =>
- if Traverse_Field (Union_Id (Field1 (Node))) = Abandon
+ if Traverse_Field (Node, Union_Id (Field1 (Node)), 1) = Abandon
or else
- Traverse_Field (Union_Id (Field2 (Node))) = Abandon
+ Traverse_Field (Node, Union_Id (Field2 (Node)), 2) = Abandon
or else
- Traverse_Field (Union_Id (Field3 (Node))) = Abandon
+ Traverse_Field (Node, Union_Id (Field3 (Node)), 3) = Abandon
or else
- Traverse_Field (Union_Id (Field4 (Node))) = Abandon
+ Traverse_Field (Node, Union_Id (Field4 (Node)), 4) = Abandon
or else
- Traverse_Field (Union_Id (Field5 (Node))) = Abandon
+ Traverse_Field (Node, Union_Id (Field5 (Node)), 5) = Abandon
then
return Abandon;
-
else
return OK;
end if;
when OK_Orig =>
declare
- Onode : constant Node_Id := Original_Node (Node);
-
+ Onod : constant Node_Id := Original_Node (Node);
begin
- if Traverse_Field (Union_Id (Field1 (Onode))) = Abandon
+ if Traverse_Field (Onod, Union_Id (Field1 (Onod)), 1) = Abandon
or else
- Traverse_Field (Union_Id (Field2 (Onode))) = Abandon
+ Traverse_Field (Onod, Union_Id (Field2 (Onod)), 2) = Abandon
or else
- Traverse_Field (Union_Id (Field3 (Onode))) = Abandon
+ Traverse_Field (Onod, Union_Id (Field3 (Onod)), 3) = Abandon
or else
- Traverse_Field (Union_Id (Field4 (Onode))) = Abandon
+ Traverse_Field (Onod, Union_Id (Field4 (Onod)), 4) = Abandon
or else
- Traverse_Field (Union_Id (Field5 (Onode))) = Abandon
+ Traverse_Field (Onod, Union_Id (Field5 (Onod)), 5) = Abandon
then
return Abandon;
-
else
return OK_Orig;
end if;
@@ -2681,6 +2681,12 @@ package body Atree is
return Nodes.Table (N + 4).Field9;
end Field27;
+ function Field28 (N : Node_Id) return Union_Id is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ return Nodes.Table (N + 4).Field10;
+ end Field28;
+
function Node1 (N : Node_Id) return Node_Id is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -2843,6 +2849,12 @@ package body Atree is
return Node_Id (Nodes.Table (N + 4).Field9);
end Node27;
+ function Node28 (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ return Node_Id (Nodes.Table (N + 4).Field10);
+ end Node28;
+
function List1 (N : Node_Id) return List_Id is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -2995,16 +3007,16 @@ package body Atree is
end if;
end Elist23;
- function Elist24 (N : Node_Id) return Elist_Id is
+ function Elist25 (N : Node_Id) return Elist_Id is
pragma Assert (Nkind (N) in N_Entity);
- Value : constant Union_Id := Nodes.Table (N + 4).Field6;
+ Value : constant Union_Id := Nodes.Table (N + 4).Field7;
begin
if Value = 0 then
return No_Elist;
else
return Elist_Id (Value);
end if;
- end Elist24;
+ end Elist25;
function Name1 (N : Node_Id) return Name_Id is
begin
@@ -4647,6 +4659,12 @@ package body Atree is
Nodes.Table (N + 4).Field9 := Val;
end Set_Field27;
+ procedure Set_Field28 (N : Node_Id; Val : Union_Id) is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ Nodes.Table (N + 4).Field10 := Val;
+ end Set_Field28;
+
procedure Set_Node1 (N : Node_Id; Val : Node_Id) is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -4809,6 +4827,12 @@ package body Atree is
Nodes.Table (N + 4).Field9 := Union_Id (Val);
end Set_Node27;
+ procedure Set_Node28 (N : Node_Id; Val : Node_Id) is
+ begin
+ pragma Assert (Nkind (N) in N_Entity);
+ Nodes.Table (N + 4).Field10 := Union_Id (Val);
+ end Set_Node28;
+
procedure Set_List1 (N : Node_Id; Val : List_Id) is
begin
pragma Assert (N in Nodes.First .. Nodes.Last);
@@ -4908,11 +4932,11 @@ package body Atree is
Nodes.Table (N + 3).Field10 := Union_Id (Val);
end Set_Elist23;
- procedure Set_Elist24 (N : Node_Id; Val : Elist_Id) is
+ procedure Set_Elist25 (N : Node_Id; Val : Elist_Id) is
begin
pragma Assert (Nkind (N) in N_Entity);
- Nodes.Table (N + 4).Field6 := Union_Id (Val);
- end Set_Elist24;
+ Nodes.Table (N + 4).Field7 := Union_Id (Val);
+ end Set_Elist25;
procedure Set_Name1 (N : Node_Id; Val : Name_Id) is
begin