]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-gcc/m2type.h
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-gcc / m2type.h
CommitLineData
1eee94d3
GM
1/* m2type.h header file for m2type.cc.
2
a945c346 3Copyright (C) 2012-2024 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius@glam.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Modula-2; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22#if !defined(m2type_h)
23#define m2type_h
24#if defined(m2type_c)
25#if defined(__GNUG__)
26#define EXTERN extern "C"
27#else /* !__GNUG__. */
28#define EXTERN
29#endif /* !__GNUG__. */
30#else /* !m2type_c. */
31#if defined(__GNUG__)
32#define EXTERN extern "C"
33#else /* !__GNUG__. */
34#define EXTERN extern
35#endif /* !__GNUG__. */
36#endif /* !m2type_c. */
37
431c0669
GM
38#include <stdbool.h>
39
1eee94d3
GM
40typedef void *m2type_Constructor;
41
431c0669
GM
42EXTERN bool m2type_ValueInTypeRange (tree type, tree value);
43EXTERN bool m2type_ExceedsTypeRange (tree type, tree low, tree high);
44EXTERN bool m2type_ValueOutOfTypeRange (tree type, tree value);
45EXTERN bool m2type_WithinTypeRange (tree type, tree low, tree high);
1eee94d3
GM
46EXTERN tree m2type_BuildStartArrayType (tree index_type, tree elt_type,
47 int type);
48EXTERN void m2type_PutArrayType (tree array, tree type);
49EXTERN tree m2type_BuildEndArrayType (tree arraytype, tree elementtype,
50 tree indextype, int type);
51EXTERN tree m2type_GetArrayNoOfElements (location_t location, tree arraytype);
52EXTERN tree m2type_BuildArrayIndexType (tree low, tree high);
53EXTERN void m2type_GarbageCollect (void);
54EXTERN void m2type_MarkFunctionReferenced (tree f);
55EXTERN void m2type_AddStatement (location_t location, tree t);
56EXTERN tree m2type_BuildNumberOfArrayElements (location_t location,
57 tree arrayType);
58EXTERN tree m2type_BuildPackedFieldRecord (location_t location, char *name,
59 tree fieldtype);
60EXTERN tree m2type_SetRecordFieldOffset (tree field, tree byteOffset,
61 tree bitOffset, tree fieldtype,
62 tree nbits);
63EXTERN tree m2type_SetTypePacked (tree node);
64EXTERN tree m2type_SetDeclPacked (tree node);
65EXTERN tree m2type_SetAlignment (tree node, tree align);
66EXTERN tree m2type_BuildEndRecord (location_t location, tree record,
431c0669 67 tree fieldlist, bool isPacked);
1eee94d3
GM
68EXTERN tree m2type_AddStringToTreeList (tree list, tree string);
69EXTERN tree m2type_ChainOnParamValue (tree list, tree name, tree str,
70 tree value);
71EXTERN tree m2type_ChainOn (tree t1, tree t2);
72EXTERN tree m2type_BuildFieldRecord (location_t location, char *name,
73 tree type);
74EXTERN tree m2type_BuildStartFieldRecord (location_t location, char *name,
75 tree type);
76EXTERN tree m2type_BuildEndFieldVarient (location_t location,
77 tree varientField, tree varientList,
431c0669 78 bool isPacked);
1eee94d3
GM
79EXTERN tree m2type_BuildStartFieldVarient (location_t location, char *name);
80EXTERN tree m2type_BuildEndVarient (location_t location, tree varientField,
431c0669 81 tree varientList, bool isPacked);
1eee94d3
GM
82EXTERN tree m2type_BuildStartVarient (location_t location, char *name);
83EXTERN tree m2type_BuildStartUnion (location_t location, char *name);
84EXTERN tree m2type_BuildStartRecord (location_t location, char *name);
85EXTERN tree m2type_RealToTree (char *name);
86EXTERN tree m2type_BuildArrayStringConstructor (location_t location,
87 tree arrayType, tree str,
88 tree length);
89
90#if 0
91EXTERN tree m2type_GetPointerOne (void);
92EXTERN tree m2type_GetPointerZero (void);
93EXTERN tree m2type_GetWordOne (void);
94EXTERN tree m2type_GetWordZero (void);
95#endif
96
97EXTERN tree m2type_GetM2CharType (void);
98EXTERN tree m2type_GetM2IntegerType (void);
99EXTERN tree m2type_GetM2ShortRealType (void);
100EXTERN tree m2type_GetM2RealType (void);
101EXTERN tree m2type_GetM2LongRealType (void);
102EXTERN tree m2type_GetM2LongIntType (void);
103EXTERN tree m2type_GetM2LongCardType (void);
104EXTERN tree m2type_GetM2ShortIntType (void);
105EXTERN tree m2type_GetShortIntType (void);
106EXTERN tree m2type_GetM2ShortCardType (void);
107EXTERN tree m2type_GetShortCardType (void);
108EXTERN tree m2type_GetISOWordType (void);
109EXTERN tree m2type_GetISOByteType (void);
110EXTERN tree m2type_GetISOLocType (void);
111EXTERN tree m2type_GetM2Integer8 (void);
112EXTERN tree m2type_GetM2Integer16 (void);
113EXTERN tree m2type_GetM2Integer32 (void);
114EXTERN tree m2type_GetM2Integer64 (void);
115EXTERN tree m2type_GetM2Cardinal8 (void);
116EXTERN tree m2type_GetM2Cardinal16 (void);
117EXTERN tree m2type_GetM2Cardinal32 (void);
118EXTERN tree m2type_GetM2Cardinal64 (void);
119EXTERN tree m2type_GetM2Word16 (void);
120EXTERN tree m2type_GetM2Word32 (void);
121EXTERN tree m2type_GetM2Word64 (void);
122EXTERN tree m2type_GetM2Bitset8 (void);
123EXTERN tree m2type_GetM2Bitset16 (void);
124EXTERN tree m2type_GetM2Bitset32 (void);
125EXTERN tree m2type_GetM2Real32 (void);
126EXTERN tree m2type_GetM2Real64 (void);
127EXTERN tree m2type_GetM2Real96 (void);
128EXTERN tree m2type_GetM2Real128 (void);
129EXTERN tree m2type_GetM2Complex32 (void);
130EXTERN tree m2type_GetM2Complex64 (void);
131EXTERN tree m2type_GetM2Complex96 (void);
132EXTERN tree m2type_GetM2Complex128 (void);
133EXTERN tree m2type_GetM2ShortComplexType (void);
134EXTERN tree m2type_GetM2LongComplexType (void);
135EXTERN tree m2type_GetM2ComplexType (void);
136EXTERN tree m2type_GetShortCardType (void);
137EXTERN tree m2type_GetProcType (void);
138EXTERN tree m2type_GetCSizeTType (void);
139EXTERN tree m2type_GetCSSizeTType (void);
140
141EXTERN tree m2type_GetM2CType (void);
142
143EXTERN tree m2type_GetBitsetType (void);
144EXTERN tree m2type_GetM2CardinalType (void);
145EXTERN tree m2type_GetWordType (void);
146EXTERN tree m2type_GetIntegerType (void);
147EXTERN tree m2type_GetCardinalType (void);
148EXTERN tree m2type_GetPointerType (void);
149EXTERN tree m2type_GetLongIntType (void);
150EXTERN tree m2type_GetShortRealType (void);
151EXTERN tree m2type_GetLongRealType (void);
152EXTERN tree m2type_GetRealType (void);
153EXTERN tree m2type_GetBitnumType (void);
154EXTERN tree m2type_GetVoidType (void);
155EXTERN tree m2type_GetByteType (void);
156EXTERN tree m2type_GetCharType (void);
157EXTERN tree m2type_GetPackedBooleanType (void);
158EXTERN tree m2type_GetBooleanTrue (void);
159EXTERN tree m2type_GetBooleanFalse (void);
160EXTERN tree m2type_GetBooleanType (void);
161EXTERN tree m2type_BuildSmallestTypeRange (location_t location, tree low,
162 tree high);
163EXTERN tree m2type_BuildSetTypeFromSubrange (location_t location, char *name,
164 tree subrangeType, tree lowval,
431c0669 165 tree highval, bool ispacked);
1eee94d3
GM
166EXTERN int m2type_GetBitsPerBitset (void);
167EXTERN tree m2type_GetM2RType (void);
168EXTERN tree m2type_GetM2ZType (void);
169
170EXTERN tree m2type_DeclareKnownType (location_t location, char *name,
171 tree type);
172EXTERN tree m2type_GetTreeType (tree type);
173EXTERN tree m2type_BuildEndFunctionType (tree func, tree type,
8804eb0b 174 bool uses_varargs);
1eee94d3
GM
175EXTERN tree m2type_BuildStartFunctionType (
176 location_t location ATTRIBUTE_UNUSED, char *name ATTRIBUTE_UNUSED);
177EXTERN void m2type_InitFunctionTypeParameters (void);
178EXTERN tree m2type_BuildVariableArrayAndDeclare (location_t location,
179 tree elementtype, tree high,
180 char *name, tree scope);
181EXTERN void m2type_InitSystemTypes (location_t location, int loc);
182EXTERN void m2type_InitBaseTypes (location_t location);
183EXTERN tree m2type_BuildStartType (location_t location, char *name, tree type);
184EXTERN tree m2type_BuildEndType (location_t location, tree type);
185EXTERN tree m2type_GetDefaultType (location_t location, char *name, tree type);
186EXTERN tree m2type_GetMinFrom (location_t location, tree type);
187EXTERN tree m2type_GetMaxFrom (location_t location, tree type);
188EXTERN void m2type_BuildTypeDeclaration (location_t location, tree type);
189EXTERN tree m2type_BuildStartEnumeration (location_t location, char *name,
431c0669 190 bool ispacked);
1eee94d3
GM
191EXTERN tree m2type_BuildEndEnumeration (location_t location, tree enumtype,
192 tree enumvalues);
193EXTERN tree m2type_BuildEnumerator (location_t location, char *name,
194 tree value, tree *enumvalues);
195EXTERN tree m2type_BuildPointerType (tree totype);
196EXTERN tree m2type_BuildConstPointerType (tree totype);
197EXTERN tree m2type_BuildSetType (location_t location, char *name, tree type,
431c0669 198 tree lowval, tree highval, bool ispacked);
1eee94d3
GM
199EXTERN void *m2type_BuildStartSetConstructor (tree type);
200EXTERN void m2type_BuildSetConstructorElement (void *p, tree value);
201EXTERN tree m2type_BuildEndSetConstructor (void *p);
202EXTERN void *m2type_BuildStartRecordConstructor (tree type);
203EXTERN tree m2type_BuildEndRecordConstructor (void *p);
204EXTERN void m2type_BuildRecordConstructorElement (void *p, tree value);
205EXTERN void *m2type_BuildStartArrayConstructor (tree type);
206EXTERN tree m2type_BuildEndArrayConstructor (void *p);
207EXTERN void m2type_BuildArrayConstructorElement (void *p, tree value,
208 tree indice);
209EXTERN tree m2type_BuildCharConstant (location_t location, const char *string);
210EXTERN tree m2type_BuildCharConstantChar (location_t location, char ch);
211EXTERN tree m2type_BuildSubrangeType (location_t location, char *name,
212 tree type, tree lowval, tree highval);
213EXTERN tree m2type_gm2_unsigned_type (tree type);
214EXTERN tree m2type_gm2_signed_type (tree type);
215EXTERN tree m2type_gm2_signed_or_unsigned_type (int unsignedp, tree type);
216EXTERN tree m2type_gm2_type_for_size (unsigned int bits, int unsignedp);
217EXTERN tree m2type_BuildProcTypeParameterDeclaration (location_t location,
218 tree type,
431c0669 219 bool isreference);
1eee94d3
GM
220EXTERN int m2type_IsAddress (tree type);
221EXTERN tree m2type_GetCardinalAddressType (void);
81d5ca0b
GM
222EXTERN bool m2type_SameRealType (tree a, tree b);
223
1eee94d3
GM
224
225#undef EXTERN
226#endif /* m2type_h */