aboutsummaryrefslogtreecommitdiff
path: root/gcc/m2/gm2-gcc/m2decl.h
blob: f651042fef25819fb210d360db061aff0f365b5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* m2decl.h header file for m2decl.cc.

Copyright (C) 2012-2022 Free Software Foundation, Inc.
Contributed by Gaius Mulley <gaius@glam.ac.uk>.

This file is part of GNU Modula-2.

GNU Modula-2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.

GNU Modula-2 is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Modula-2; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */

#if !defined(m2decl_h)

#define m2decl_h
#if defined(m2decl_c)
#if defined(__GNUG__)
#define EXTERN extern "C"
#else /* !__GNUG__.  */
#define EXTERN
#endif /* !__GNUG__.  */
#else /* !m2decl_c.  */
#if defined(__GNUG__)
#define EXTERN extern "C"
#else /* !__GNUG__.  */
#define EXTERN extern
#endif /* !__GNUG__.  */
#endif /* !m2decl_c.  */

EXTERN void m2decl_DeclareM2linkGlobals (location_t location,
					 int ScaffoldStatic, const char *RuntimeOverride);
EXTERN void m2decl_BuildModuleCtor (tree module_ctor);
EXTERN tree m2decl_DeclareModuleCtor (tree decl);
EXTERN tree m2decl_GetDeclContext (tree t);
EXTERN tree m2decl_BuildStringConstant (location_t location, const char *string, int length);
EXTERN tree m2decl_BuildCStringConstant (const char *string, int length);
EXTERN tree m2decl_BuildConstLiteralNumber (const char *str,
                                            unsigned int base);
EXTERN void m2decl_DetermineSizeOfConstant (const char *str, unsigned int base,
                                            int *needsLong,
                                            int *needsUnsigned);
EXTERN void m2decl_RememberVariables (tree l);

EXTERN tree m2decl_BuildEndFunctionDeclaration (
    location_t location_begin, location_t location_end, const char *name,
    tree returntype, int isexternal, int isnested, int ispublic);
EXTERN void m2decl_BuildStartFunctionDeclaration (int uses_varargs);
EXTERN tree m2decl_BuildParameterDeclaration (location_t location, char *name,
                                              tree type, int isreference);
EXTERN tree m2decl_DeclareKnownConstant (location_t location, tree type,
                                         tree value);
EXTERN tree m2decl_DeclareKnownVariable (location_t location, char *name,
                                         tree type, int exported, int imported,
                                         int istemporary, int isglobal,
                                         tree scope);

EXTERN tree m2decl_BuildStringConstantType (int length, const char *string,
                                            tree type);
EXTERN tree m2decl_BuildIntegerConstant (int value);

EXTERN int m2decl_GetBitsPerWord (void);
EXTERN int m2decl_GetBitsPerUnit (void);
EXTERN int m2decl_GetBitsPerInt (void);
EXTERN int m2decl_GetBitsPerBitset (void);

#undef EXTERN
#endif /* m2decl_h.  */