Add an UNSPEC_PROLOGUE_USE to prevent the link register from being considered dead.
[official-gcc.git] / gcc / ada / nlists.h
bloba71275e6d381fd2a4b2b7f2d574e0352a523161c
1 /****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * N L I S T S *
6 * *
7 * C Header File *
8 * *
9 * *
10 * Copyright (C) 1992-2001, Free Software Foundation, Inc. *
11 * *
12 * GNAT is free software; you can redistribute it and/or modify it under *
13 * terms of the GNU General Public License as published by the Free Soft- *
14 * ware Foundation; either version 2, or (at your option) any later ver- *
15 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
16 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
18 * for more details. You should have received a copy of the GNU General *
19 * Public License distributed with GNAT; see file COPYING. If not, write *
20 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
21 * MA 02111-1307, USA. *
22 * *
23 * GNAT was originally developed by the GNAT team at New York University. *
24 * Extensive contributions were provided by Ada Core Technologies Inc. *
25 * *
26 ****************************************************************************/
28 /* This is the C header corresponding to the Ada package specification for
29 Nlists. It also contains the implementations of inlined functions from the
30 the package body for Nlists. It was generated manually from nlists.ads and
31 nlists.adb and must be kept synchronized with changes in these files.
33 Note that only routines for reading the tree are included, since the
34 tree transformer is not supposed to modify the tree in any way. */
36 /* The following is the structure used for the list headers table */
38 struct List_Header
40 Node_Id first;
41 Node_Id last;
42 Node_Id parent;
45 /* The list headers are stored in an array. The pointer to this array is
46 passed as a parameter to gigi and stored in the global variable
47 List_Headers_Ptr. */
49 extern struct List_Header *List_Headers_Ptr;
51 /* The previous and next links for lists are held in two arrays, Next_Node and
52 Prev_Node. The pointers to these arrays are passed as parameters to gigi
53 and stored in the global variables Prev_Node_Ptr and Next_Node_Ptr. */
55 extern Node_Id *Next_Node_Ptr;
56 extern Node_Id *Prev_Node_Ptr;
58 /* Node List Access Functions */
60 static Node_Id First PARAMS ((List_Id));
62 INLINE Node_Id
63 First (List)
64 List_Id List;
66 return List_Headers_Ptr[List - First_List_Id].first;
69 #define First_Non_Pragma nlists__first_non_pragma
70 extern Node_Id First_Non_Pragma PARAMS ((Node_Id));
72 static Node_Id Last PARAMS ((List_Id));
74 INLINE Node_Id
75 Last (List)
76 List_Id List;
78 return List_Headers_Ptr[List - First_List_Id].last;
81 #define First_Non_Pragma nlists__first_non_pragma
82 extern Node_Id First_Non_Pragma PARAMS ((List_Id));
84 static Node_Id Next PARAMS ((Node_Id));
86 INLINE Node_Id
87 Next (Node)
88 Node_Id Node;
90 return Next_Node_Ptr[Node - First_Node_Id];
93 #define Next_Non_Pragma nlists__next_non_pragma
94 extern Node_Id Next_Non_Pragma PARAMS ((List_Id));
96 static Node_Id Prev PARAMS ((Node_Id));
98 INLINE Node_Id
99 Prev (Node)
100 Node_Id Node;
102 return Prev_Node_Ptr[Node - First_Node_Id];
106 #define Prev_Non_Pragma nlists__prev_non_pragma
107 extern Node_Id Prev_Non_Pragma PARAMS ((Node_Id));
109 static Boolean Is_Empty_List PARAMS ((List_Id));
110 static Boolean Is_Non_Empty_List PARAMS ((List_Id));
111 static Boolean Is_List_Member PARAMS ((Node_Id));
112 static List_Id List_Containing PARAMS ((Node_Id));
114 INLINE Boolean
115 Is_Empty_List (Id)
116 List_Id Id;
118 return (First (Id) == Empty);
121 INLINE Boolean
122 Is_Non_Empty_List (Id)
123 List_Id Id;
125 return (Present (Id) && First (Id) != Empty);
128 INLINE Boolean
129 Is_List_Member (Node)
130 Node_Id Node;
132 return Nodes_Ptr[Node - First_Node_Id].U.K.in_list;
135 INLINE List_Id
136 List_Containing (Node)
137 Node_Id Node;
139 return Nodes_Ptr[Node - First_Node_Id].V.NX.link;