annotate gcc/ada/elists.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /****************************************************************************
kono
parents:
diff changeset
2 * *
kono
parents:
diff changeset
3 * GNAT COMPILER COMPONENTS *
kono
parents:
diff changeset
4 * *
kono
parents:
diff changeset
5 * E L I S T S *
kono
parents:
diff changeset
6 * *
kono
parents:
diff changeset
7 * C Header File *
kono
parents:
diff changeset
8 * *
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
9 * Copyright (C) 1992-2018, Free Software Foundation, Inc. *
111
kono
parents:
diff changeset
10 * *
kono
parents:
diff changeset
11 * GNAT is free software; you can redistribute it and/or modify it under *
kono
parents:
diff changeset
12 * terms of the GNU General Public License as published by the Free Soft- *
kono
parents:
diff changeset
13 * ware Foundation; either version 3, or (at your option) any later ver- *
kono
parents:
diff changeset
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
kono
parents:
diff changeset
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
kono
parents:
diff changeset
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
kono
parents:
diff changeset
17 * for more details. You should have received a copy of the GNU General *
kono
parents:
diff changeset
18 * Public License distributed with GNAT; see file COPYING3. If not, go to *
kono
parents:
diff changeset
19 * http://www.gnu.org/licenses for a complete copy of the license. *
kono
parents:
diff changeset
20 * *
kono
parents:
diff changeset
21 * GNAT was originally developed by the GNAT team at New York University. *
kono
parents:
diff changeset
22 * Extensive contributions were provided by Ada Core Technologies Inc. *
kono
parents:
diff changeset
23 * *
kono
parents:
diff changeset
24 ****************************************************************************/
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* This is the C header corresponding to the Ada package specification for
kono
parents:
diff changeset
27 Elists. It also contains the implementations of inlined functions from the
kono
parents:
diff changeset
28 package body for Elists. It was generated manually from elists.ads and
kono
parents:
diff changeset
29 elists.adb and must be kept synchronized with changes in these files.
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 Note that only routines for reading the tree are included, since the
kono
parents:
diff changeset
32 tree transformer is not supposed to modify the tree in any way. */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* The following are the structures used to hold element lists */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 struct Elist_Header
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 Elmt_Id first;
kono
parents:
diff changeset
39 Elmt_Id last;
kono
parents:
diff changeset
40 };
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 struct Elmt_Item
kono
parents:
diff changeset
43 {
kono
parents:
diff changeset
44 Node_Id node;
kono
parents:
diff changeset
45 Int next;
kono
parents:
diff changeset
46 };
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* The element list headers and element descriptors themselves are stored in
kono
parents:
diff changeset
49 two arrays. The pointers to these arrays are passed as a parameter to the
kono
parents:
diff changeset
50 tree transformer procedure and stored in the global variables Elists_Ptr
kono
parents:
diff changeset
51 and Elmts_Ptr. */
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 extern struct Elist_Header *Elists_Ptr;
kono
parents:
diff changeset
54 extern struct Elmt_Item *Elmts_Ptr;
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* Element List Access Functions: */
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 static Node_Id Node (Elmt_Id);
kono
parents:
diff changeset
59 static Elmt_Id First_Elmt (Elist_Id);
kono
parents:
diff changeset
60 static Elmt_Id Last_Elmt (Elist_Id);
kono
parents:
diff changeset
61 static Elmt_Id Next_Elmt (Elmt_Id);
kono
parents:
diff changeset
62 static Boolean Is_Empty_Elmt_List (Elist_Id);
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 INLINE Node_Id
kono
parents:
diff changeset
65 Node (Elmt_Id Elmt)
kono
parents:
diff changeset
66 {
kono
parents:
diff changeset
67 return Elmts_Ptr[Elmt - First_Elmt_Id].node;
kono
parents:
diff changeset
68 }
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 INLINE Elmt_Id
kono
parents:
diff changeset
71 First_Elmt (Elist_Id List)
kono
parents:
diff changeset
72 {
kono
parents:
diff changeset
73 return Elists_Ptr[List - First_Elist_Id].first;
kono
parents:
diff changeset
74 }
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 INLINE Elmt_Id
kono
parents:
diff changeset
77 Last_Elmt (Elist_Id List)
kono
parents:
diff changeset
78 {
kono
parents:
diff changeset
79 return Elists_Ptr[List - First_Elist_Id].last;
kono
parents:
diff changeset
80 }
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 INLINE Elmt_Id
kono
parents:
diff changeset
83 Next_Elmt (Elmt_Id Node)
kono
parents:
diff changeset
84 {
kono
parents:
diff changeset
85 Int N = Elmts_Ptr[Node - First_Elmt_Id].next;
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 if (IN (N, Elist_Range))
kono
parents:
diff changeset
88 return No_Elmt;
kono
parents:
diff changeset
89 else
kono
parents:
diff changeset
90 return N;
kono
parents:
diff changeset
91 }
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 INLINE Boolean
kono
parents:
diff changeset
94 Is_Empty_Elmt_List (Elist_Id Id)
kono
parents:
diff changeset
95 {
kono
parents:
diff changeset
96 return Elists_Ptr[Id - First_Elist_Id].first == No_Elmt;
kono
parents:
diff changeset
97 }