aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/cil32/cil-refs.h
blob: b4a92d3714f9c24d01def83d71b514e35b1eb817 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* Database of entities referenced in a compilation unit.

   Copyright (C) 2006-2009 Free Software Foundation, Inc.

This file is part of GCC.

GCC 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 2, or (at your option) any later
version.

GCC 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 GCC; see the file COPYING.  If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.

Authors:
   Andrea Ornstein
   Erven Rohou
   Gabriele Svelto

Contact information at STMicroelectronics:
Andrea C. Ornstein      <andrea.ornstein@st.com>
Contact information at INRIA:
Erven Rohou             <erven.rohou@inria.fr>
*/

#ifndef CIL_REFS_H
#define CIL_REFS_H

#include "coretypes.h"
#include "ggc.h"
#include "debug.h"
#include "hashtab.h"
#include "tree.h"
#include "cil-types.h"

/******************************************************************************
 * Macros                                                                     *
 ******************************************************************************/

/* Nonzero for a type which is at file scope.  */
#define TYPE_FILE_SCOPE_P(EXP) \
  (!TYPE_CONTEXT (EXP) \
   || TREE_CODE (TYPE_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)

/* Nonzero for a zero-length array type */
#define ARRAY_TYPE_ZEROLENGTH(EXP) \
  ((TYPE_SIZE (EXP) == NULL_TREE) || integer_zerop (TYPE_SIZE (EXP)))

/* Nonzero for a variable-length array type */
#define ARRAY_TYPE_VARLENGTH(EXP) \
  (TYPE_SIZE (EXP) != NULL_TREE && TREE_CODE (TYPE_SIZE (EXP)) != INTEGER_CST)

/* Length of compacted identifiers (in characters) */
#define COMPACT_ID_LENGTH 16

/*****************************************************************************
 * Initialization and teardown                                               *
 *****************************************************************************/

extern void refs_init (void);
extern void refs_fini (void);

/*****************************************************************************
 * Referenced assemblies                                                     *
 *****************************************************************************/

extern void add_referenced_assembly (const char *);
extern htab_t pending_assemblies_htab ( void );
extern void mark_pending_assemblies ( void );

/*****************************************************************************
 * Types                                                                     *
 *****************************************************************************/

extern void mark_referenced_type (tree);
extern htab_t referenced_types_htab ( void );
extern tree promote_type_for_vararg (tree);
extern tree promote_local_var_type (tree);
extern bool cil_pointer_type_p (tree);
extern tree get_integer_type (unsigned int, bool);

/******************************************************************************
 * Strings                                                                    *
 ******************************************************************************/

extern tree mark_referenced_string (tree);
extern unsigned int get_string_cst_id (tree);
extern htab_t referenced_strings_htab ( void );

/******************************************************************************
 * Functions                                                                  *
 ******************************************************************************/

extern void add_pinvoke (tree);
extern htab_t pinvokes_htab ( void );

/******************************************************************************
 * Labels                                                                     *
 ******************************************************************************/

extern void record_addr_taken_label (tree);
extern tree get_addr_taken_label_id (tree);
extern tree get_label_addrs ( void );

/******************************************************************************
 * Constructors                                                               *
 ******************************************************************************/

extern void record_ctor (tree);
extern void create_init_method (void);
extern void expand_init_to_stmt_list (tree, tree, tree *);

#endif /* !CIL_REFS_H */