OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [ada/] [elists.h] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.