]> gcc.gnu.org Git - gcc.git/blob - gcc/m2/gm2-gcc/m2expr.h
61ca6cb0cfc649d430534f676a3f928f692f669e
[gcc.git] / gcc / m2 / gm2-gcc / m2expr.h
1 /* m2expr.h header file for m2expr.c.
2
3 Copyright (C) 2012-2021 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius@glam.ac.uk>.
5
6 This file is part of GNU Modula-2.
7
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Modula-2; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22 #if !defined(m2expr_h)
23 #define m2expr_h
24 #if defined(m2expr_c)
25 #if defined(__GNUG__)
26 #define EXTERN extern "C"
27 #else /* !__GNUG__. */
28 #define EXTERN
29 #endif /* !__GNUG__. */
30 #else /* !m2expr_c. */
31 #if defined(__GNUG__)
32 #define EXTERN extern "C"
33 #else /* !__GNUG__. */
34 #define EXTERN extern
35 #endif /* !__GNUG__. */
36 #endif /* !m2expr_c. */
37
38 EXTERN void m2expr_BuildBinaryForeachWordDo (
39 location_t location, tree type, tree op1, tree op2, tree op3,
40 tree (*binop) (location_t, tree, tree, int), int is_op1lvalue,
41 int is_op2lvalue, int is_op3lvalue, int is_op1const, int is_op2const,
42 int is_op3const);
43 EXTERN tree m2expr_BuildCmplx (location_t location, tree type, tree real,
44 tree imag);
45 EXTERN tree m2expr_BuildIm (tree op1);
46 EXTERN tree m2expr_BuildRe (tree op1);
47 EXTERN tree m2expr_BuildAbs (location_t location, tree t);
48 EXTERN tree m2expr_BuildCap (location_t location, tree t);
49 EXTERN int m2expr_DetermineSign (tree e);
50 EXTERN int m2expr_AreRealOrComplexConstantsEqual (tree e1, tree e2);
51 EXTERN int m2expr_AreConstantsEqual (tree e1, tree e2);
52 EXTERN int m2expr_IsFalse (tree t);
53 EXTERN int m2expr_IsTrue (tree t);
54 EXTERN tree m2expr_BuildIndirect (location_t location, tree target, tree type);
55 EXTERN tree m2expr_BuildComponentRef (location_t location, tree record,
56 tree field);
57 EXTERN tree m2expr_BuildArray (location_t location, tree type, tree array,
58 tree index, tree lowIndice);
59 EXTERN void m2expr_BuildIfNotInRangeGoto (location_t location, tree var,
60 tree low, tree high, char *label);
61 EXTERN void m2expr_BuildIfInRangeGoto (location_t location, tree var, tree low,
62 tree high, char *label);
63 EXTERN void m2expr_BuildForeachWordInSetDoIfExpr (
64 location_t location, tree type, tree op1, tree op2, int is_op1lvalue,
65 int is_op2lvalue, int is_op1const, int is_op2const,
66 tree (*expr) (location_t, tree, tree), char *label);
67 EXTERN void m2expr_BuildIfNotVarInVar (location_t location, tree type,
68 tree varset, tree varel, int is_lvalue,
69 tree low, tree high ATTRIBUTE_UNUSED,
70 char *label);
71 EXTERN void m2expr_BuildIfVarInVar (location_t location, tree type,
72 tree varset, tree varel, int is_lvalue,
73 tree low, tree high ATTRIBUTE_UNUSED,
74 char *label);
75 EXTERN void m2expr_BuildIfNotConstInVar (location_t location, tree type,
76 tree varset, tree constel,
77 int is_lvalue, int fieldno,
78 char *label);
79 EXTERN void m2expr_BuildIfConstInVar (location_t location, tree type,
80 tree varset, tree constel, int is_lvalue,
81 int fieldno, char *label);
82 EXTERN tree m2expr_BuildIsNotSubset (location_t location, tree op1, tree op2);
83 EXTERN tree m2expr_BuildIsSubset (location_t location, tree op1, tree op2);
84 EXTERN tree m2expr_BuildIsNotSuperset (location_t location, tree op1,
85 tree op2);
86 EXTERN tree m2expr_BuildIsSuperset (location_t location, tree op1, tree op2);
87 EXTERN tree m2expr_BuildNotEqualTo (location_t location, tree op1, tree op2);
88 EXTERN tree m2expr_BuildEqualTo (location_t location, tree op1, tree op2);
89 EXTERN tree m2expr_BuildGreaterThanOrEqual (location_t location, tree op1,
90 tree op2);
91 EXTERN tree m2expr_BuildLessThanOrEqual (location_t location, tree op1,
92 tree op2);
93 EXTERN tree m2expr_BuildGreaterThan (location_t location, tree op1, tree op2);
94 EXTERN tree m2expr_BuildLessThan (location_t location, tree op1, tree op2);
95 EXTERN tree m2expr_BuildLogicalDifference (location_t location, tree op1,
96 tree op2, int needconvert);
97 EXTERN tree m2expr_BuildSymmetricDifference (location_t location, tree op1,
98 tree op2, int needconvert);
99 EXTERN tree m2expr_BuildLogicalAnd (location_t location, tree op1, tree op2,
100 int needconvert);
101 EXTERN tree m2expr_BuildLogicalOr (location_t location, tree op1, tree op2,
102 int needconvert);
103 EXTERN tree m2expr_BuildLogicalOrAddress (location_t location, tree op1,
104 tree op2, int needconvert);
105 EXTERN tree m2expr_BuildOffset (location_t location, tree record, tree field,
106 int needconvert ATTRIBUTE_UNUSED);
107 EXTERN tree m2expr_BuildOffset1 (location_t location, tree field,
108 int needconvert ATTRIBUTE_UNUSED);
109 EXTERN tree m2expr_BuildAddr (location_t location, tree op1, int needconvert);
110 EXTERN tree m2expr_BuildSize (location_t location, tree op1,
111 int needconvert ATTRIBUTE_UNUSED);
112 EXTERN tree m2expr_BuildTBitSize (location_t location, tree type);
113 EXTERN tree m2expr_BuildSetNegate (location_t location, tree op1,
114 int needconvert);
115 EXTERN tree m2expr_BuildNegate (location_t location, tree op1,
116 int needconvert);
117 EXTERN tree m2expr_BuildNegateCheck (location_t location, tree arg,
118 tree lowest, tree min, tree max);
119 EXTERN tree m2expr_BuildTrunc (tree op1);
120 EXTERN tree m2expr_BuildCoerce (location_t location, tree des, tree type,
121 tree expr);
122 EXTERN tree m2expr_RemoveOverflow (tree t);
123 EXTERN int m2expr_TreeOverflow (tree t);
124
125 EXTERN unsigned int m2expr_StringLength (tree string);
126 EXTERN tree m2expr_FoldAndStrip (tree t);
127 EXTERN int m2expr_interpret_integer (const char *str, unsigned int base,
128 unsigned HOST_WIDE_INT *low,
129 HOST_WIDE_INT *high);
130 EXTERN int m2expr_interpret_m2_integer (const char *str, unsigned int base,
131 unsigned int *low, int *high);
132
133 EXTERN tree m2expr_BuildAddCheck (location_t location, tree op1, tree op2,
134 tree lowest, tree min, tree max);
135 EXTERN tree m2expr_BuildSubCheck (location_t location, tree op1, tree op2,
136 tree lowest, tree min, tree max);
137 EXTERN tree m2expr_BuildMultCheck (location_t location, tree op1, tree op2,
138 tree lowest, tree min, tree max);
139
140 EXTERN tree m2expr_BuildAdd (location_t location, tree op1, tree op2,
141 int needconvert);
142 EXTERN tree m2expr_BuildSub (location_t location, tree op1, tree op2,
143 int needconvert);
144 EXTERN tree m2expr_BuildDivTrunc (location_t location, tree op1, tree op2,
145 int needconvert);
146 EXTERN tree m2expr_BuildDivTruncCheck (location_t location, tree op1, tree op2,
147 tree lowest, tree min, tree max);
148 EXTERN tree m2expr_BuildModTrunc (location_t location, tree op1, tree op2,
149 int needconvert);
150
151 EXTERN tree m2expr_BuildDivCeil (location_t location, tree op1, tree op2,
152 int needconvert);
153 EXTERN tree m2expr_BuildModCeil (location_t location, tree op1, tree op2,
154 int needconvert);
155
156 EXTERN tree m2expr_BuildDivFloor (location_t location, tree op1, tree op2,
157 int needconvert);
158 EXTERN tree m2expr_BuildModFloor (location_t location, tree op1, tree op2,
159 int needconvert);
160
161 EXTERN tree m2expr_BuildDivM2 (location_t location, tree op1, tree op2,
162 unsigned int needsconvert);
163 EXTERN tree m2expr_BuildModM2 (location_t location, tree op1, tree op2,
164 unsigned int needsconvert);
165 EXTERN tree m2expr_BuildDivM2Check (location_t location, tree op1, tree op2,
166 tree lowest, tree min, tree max);
167
168 EXTERN tree m2expr_BuildModM2Check (location_t location, tree op1, tree op2,
169 tree lowest, tree min, tree max);
170
171 EXTERN tree m2expr_BuildLSL (location_t location, tree op1, tree op2,
172 int needconvert);
173
174 EXTERN tree m2expr_BuildLSR (location_t location, tree op1, tree op2,
175 int needconvert);
176
177 EXTERN void m2expr_BuildLogicalShift (location_t location, tree op1, tree op2,
178 tree op3, tree nBits ATTRIBUTE_UNUSED,
179 int needconvert);
180
181 EXTERN tree m2expr_BuildLRL (location_t location, tree op1, tree op2,
182 int needconvert);
183
184 EXTERN tree m2expr_BuildLRR (location_t location, tree op1, tree op2,
185 int needconvert);
186 EXTERN tree m2expr_BuildMult (location_t location, tree op1, tree op2,
187 int needconvert);
188
189 EXTERN tree m2expr_BuildRRotate (location_t location, tree op1, tree nBits,
190 int needconvert);
191 EXTERN tree m2expr_BuildLRotate (location_t location, tree op1, tree nBits,
192 int needconvert);
193
194 EXTERN tree m2expr_BuildMask (location_t location, tree nBits,
195 int needconvert);
196 EXTERN tree m2expr_BuildLRLn (location_t location, tree op1, tree op2,
197 tree nBits, int needconvert);
198 EXTERN tree m2expr_BuildLRRn (location_t location, tree op1, tree op2,
199 tree nBits, int needconvert);
200 EXTERN void m2expr_BuildLogicalRotate (location_t location, tree op1, tree op2,
201 tree op3, tree nBits, int needconvert);
202 EXTERN void m2expr_BuildBinarySetDo (
203 location_t location, tree settype, tree op1, tree op2, tree op3,
204 void (*binop) (location_t, tree, tree, tree, tree, int), int is_op1lvalue,
205 int is_op2lvalue, int is_op3lvalue, tree nBits, tree unbounded,
206 tree varproc, tree leftproc, tree rightproc);
207
208 EXTERN tree m2expr_GetSizeOf (location_t location, tree type);
209 EXTERN tree m2expr_GetSizeOfInBits (tree type);
210
211 EXTERN tree m2expr_GetCardinalZero (location_t location);
212 EXTERN tree m2expr_GetCardinalOne (location_t location);
213 EXTERN tree m2expr_GetIntegerZero (location_t location);
214 EXTERN tree m2expr_GetIntegerOne (location_t location);
215 EXTERN tree m2expr_GetWordZero (location_t location);
216 EXTERN tree m2expr_GetWordOne (location_t location);
217 EXTERN tree m2expr_GetPointerZero (location_t location);
218 EXTERN tree m2expr_GetPointerOne (location_t location);
219
220 #if 0
221 EXTERN tree m2expr_GetBooleanTrue (void);
222 EXTERN tree m2expr_GetBooleanFalse (void);
223 #endif
224
225 EXTERN int m2expr_CompareTrees (tree e1, tree e2);
226 EXTERN tree m2expr_build_unary_op (location_t location ATTRIBUTE_UNUSED,
227 enum tree_code code, tree arg,
228 int flag ATTRIBUTE_UNUSED);
229 EXTERN tree m2expr_build_binary_op (location_t location, enum tree_code code,
230 tree op1, tree op2, int convert);
231 EXTERN tree m2expr_build_binary_op_check (location_t location,
232 enum tree_code code, tree op1,
233 tree op2, int needconvert,
234 tree lowest, tree min, tree max);
235 EXTERN void m2expr_ConstantExpressionWarning (tree value);
236 EXTERN tree m2expr_BuildAddAddress (location_t location, tree op1, tree op2);
237 EXTERN tree m2expr_BuildRDiv (location_t location, tree op1, tree op2,
238 int needconvert);
239
240 EXTERN void m2expr_init (location_t location);
241
242 #undef EXTERN
243 #endif /* m2expr_h. */
This page took 0.048574 seconds and 4 git commands to generate.