annotate gcc/ada/uintp.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
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 * U I N T P *
kono
parents:
diff changeset
6 * *
kono
parents:
diff changeset
7 * C Header File *
kono
parents:
diff changeset
8 * *
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 * Copyright (C) 1992-2019, 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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
26 /* This is the C header that corresponds to the Ada package specification for
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
27 Uintp. It was created manually from uintp.ads and must be kept synchronized
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
28 with changes in this file. */
111
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 #ifdef __cplusplus
kono
parents:
diff changeset
31 extern "C" {
kono
parents:
diff changeset
32 #endif
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* Support for universal integer arithmetic */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 struct Uint_Entry
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 Pos Length;
kono
parents:
diff changeset
39 Int Loc;
kono
parents:
diff changeset
40 };
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* See if a Uint is within the range of an integer. */
kono
parents:
diff changeset
43 #define UI_Is_In_Int_Range uintp__ui_is_in_int_range
kono
parents:
diff changeset
44 extern Boolean UI_Is_In_Int_Range (Uint);
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* Obtain Char_Code value from Uint input. Value must be in range. */
kono
parents:
diff changeset
47 #define UI_To_CC uintp__ui_to_cc
kono
parents:
diff changeset
48 extern Char_Code UI_To_CC (Uint);
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /* Convert a Char_Code into a Uint. */
kono
parents:
diff changeset
51 #define UI_From_CC uintp__ui_from_cc
kono
parents:
diff changeset
52 extern Uint UI_From_CC (Char_Code);
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* Obtain Int value from Uint input. Abort if the result is out of range. */
kono
parents:
diff changeset
55 #define UI_To_Int uintp__ui_to_int
kono
parents:
diff changeset
56 extern Int UI_To_Int (Uint);
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 /* Similarly, but return a GCC INTEGER_CST. */
kono
parents:
diff changeset
59 extern tree UI_To_gnu (Uint, tree);
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 /* Convert an Int into a Uint. */
kono
parents:
diff changeset
62 #define UI_From_Int uintp__ui_from_int
kono
parents:
diff changeset
63 extern Uint UI_From_Int (int);
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 /* Similarly, but take a GCC INTEGER_CST. */
kono
parents:
diff changeset
66 extern Uint UI_From_gnu (tree);
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 /* A constant value indicating a missing or unset Uint value. */
kono
parents:
diff changeset
69 #define UI_No_Uint uintp__no_uint
kono
parents:
diff changeset
70 extern const Uint UI_No_Uint;
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 /* Uint values are represented as multiple precision integers stored in a
kono
parents:
diff changeset
73 multi-digit format using UI_Base as the base. This value is chosen so
kono
parents:
diff changeset
74 that the product UI_Base*UI_Base is within the range of Int values. */
kono
parents:
diff changeset
75 #define UI_Base uintp__base
kono
parents:
diff changeset
76 extern const int UI_Base;
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 /* Types for the fat pointer of Int vectors and the template it points to. */
kono
parents:
diff changeset
79 typedef struct {int Low_Bound, High_Bound; } Vector_Template;
kono
parents:
diff changeset
80 typedef struct {const int *Array; Vector_Template *Bounds; }
kono
parents:
diff changeset
81 __attribute ((aligned (sizeof (char *) * 2))) Int_Vector;
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 /* Create and return the Uint value from the Int vector. */
kono
parents:
diff changeset
84 #define Vector_To_Uint uintp__vector_to_uint
kono
parents:
diff changeset
85 extern Uint Vector_To_Uint (Int_Vector, Boolean);
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 /* Compare integer values for equality. */
kono
parents:
diff changeset
88 #define UI_Eq uintp__ui_eq
kono
parents:
diff changeset
89 extern Boolean UI_Eq (Uint, Uint);
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 /* Compare integer values for less than. */
kono
parents:
diff changeset
92 #define UI_Lt uintp__ui_lt
kono
parents:
diff changeset
93 extern Boolean UI_Lt (Uint, Uint);
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 /* Universal integers are represented by the Uint type which is an index into
kono
parents:
diff changeset
96 the Uints_Ptr table containing Uint_Entry values. A Uint_Entry contains an
kono
parents:
diff changeset
97 index and length for getting the "digits" of the universal integer from the
kono
parents:
diff changeset
98 Udigits_Ptr table.
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 For efficiency, this method is used only for integer values larger than the
kono
parents:
diff changeset
101 constant Uint_Bias. If a Uint is less than this constant, then it contains
kono
parents:
diff changeset
102 the integer value itself. The origin of the Uints_Ptr table is adjusted so
kono
parents:
diff changeset
103 that a Uint value of Uint_Bias indexes the first element. */
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 #define Uints_Ptr (uintp__uints__table - Uint_Table_Start)
kono
parents:
diff changeset
106 extern struct Uint_Entry *uintp__uints__table;
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 #define Udigits_Ptr uintp__udigits__table
kono
parents:
diff changeset
109 extern int *uintp__udigits__table;
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 #ifdef __cplusplus
kono
parents:
diff changeset
112 }
kono
parents:
diff changeset
113 #endif