annotate gcc/stor-layout.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Definitions and declarations for stor-layout.c.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 Copyright (C) 2013-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #ifndef GCC_STOR_LAYOUT_H
kono
parents:
diff changeset
21 #define GCC_STOR_LAYOUT_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 extern void set_min_and_max_values_for_integral_type (tree, int, signop);
kono
parents:
diff changeset
24 extern void fixup_signed_type (tree);
kono
parents:
diff changeset
25 extern unsigned int update_alignment_for_field (record_layout_info, tree,
kono
parents:
diff changeset
26 unsigned int);
kono
parents:
diff changeset
27 extern record_layout_info start_record_layout (tree);
kono
parents:
diff changeset
28 extern tree bit_from_pos (tree, tree);
kono
parents:
diff changeset
29 extern tree byte_from_pos (tree, tree);
kono
parents:
diff changeset
30 extern void pos_from_bit (tree *, tree *, unsigned int, tree);
kono
parents:
diff changeset
31 extern void normalize_offset (tree *, tree *, unsigned int);
kono
parents:
diff changeset
32 extern tree rli_size_unit_so_far (record_layout_info);
kono
parents:
diff changeset
33 extern tree rli_size_so_far (record_layout_info);
kono
parents:
diff changeset
34 extern void normalize_rli (record_layout_info);
kono
parents:
diff changeset
35 extern void place_field (record_layout_info, tree);
kono
parents:
diff changeset
36 extern void compute_record_mode (tree);
kono
parents:
diff changeset
37 extern void finish_bitfield_layout (tree);
kono
parents:
diff changeset
38 extern void finish_record_layout (record_layout_info, int);
kono
parents:
diff changeset
39 extern unsigned int element_precision (const_tree);
kono
parents:
diff changeset
40 extern void finalize_size_functions (void);
kono
parents:
diff changeset
41 extern void fixup_unsigned_type (tree);
kono
parents:
diff changeset
42 extern void initialize_sizetypes (void);
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 /* Finish up a builtin RECORD_TYPE. Give it a name and provide its
kono
parents:
diff changeset
45 fields. Optionally specify an alignment, and then lay it out. */
kono
parents:
diff changeset
46 extern void finish_builtin_struct (tree, const char *, tree, tree);
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* Given a VAR_DECL, PARM_DECL, RESULT_DECL or FIELD_DECL node,
kono
parents:
diff changeset
49 calculates the DECL_SIZE, DECL_SIZE_UNIT, DECL_ALIGN and DECL_MODE
kono
parents:
diff changeset
50 fields. Call this only once for any given decl node.
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 Second argument is the boundary that this field can be assumed to
kono
parents:
diff changeset
53 be starting at (in bits). Zero means it can be assumed aligned
kono
parents:
diff changeset
54 on any boundary that may be needed. */
kono
parents:
diff changeset
55 extern void layout_decl (tree, unsigned);
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 /* Given a ..._TYPE node, calculate the TYPE_SIZE, TYPE_SIZE_UNIT,
kono
parents:
diff changeset
58 TYPE_ALIGN and TYPE_MODE fields. If called more than once on one
kono
parents:
diff changeset
59 node, does nothing except for the first time. */
kono
parents:
diff changeset
60 extern void layout_type (tree);
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 /* Return the least alignment in bytes required for type TYPE. */
kono
parents:
diff changeset
63 extern unsigned int min_align_of_type (tree);
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 /* Construct various nodes representing fract or accum data types. */
kono
parents:
diff changeset
66 extern tree make_fract_type (int, int, int);
kono
parents:
diff changeset
67 extern tree make_accum_type (int, int, int);
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #define make_signed_fract_type(P) make_fract_type (P, 0, 0)
kono
parents:
diff changeset
70 #define make_unsigned_fract_type(P) make_fract_type (P, 1, 0)
kono
parents:
diff changeset
71 #define make_sat_signed_fract_type(P) make_fract_type (P, 0, 1)
kono
parents:
diff changeset
72 #define make_sat_unsigned_fract_type(P) make_fract_type (P, 1, 1)
kono
parents:
diff changeset
73 #define make_signed_accum_type(P) make_accum_type (P, 0, 0)
kono
parents:
diff changeset
74 #define make_unsigned_accum_type(P) make_accum_type (P, 1, 0)
kono
parents:
diff changeset
75 #define make_sat_signed_accum_type(P) make_accum_type (P, 0, 1)
kono
parents:
diff changeset
76 #define make_sat_unsigned_accum_type(P) make_accum_type (P, 1, 1)
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 #define make_or_reuse_signed_fract_type(P) \
kono
parents:
diff changeset
79 make_or_reuse_fract_type (P, 0, 0)
kono
parents:
diff changeset
80 #define make_or_reuse_unsigned_fract_type(P) \
kono
parents:
diff changeset
81 make_or_reuse_fract_type (P, 1, 0)
kono
parents:
diff changeset
82 #define make_or_reuse_sat_signed_fract_type(P) \
kono
parents:
diff changeset
83 make_or_reuse_fract_type (P, 0, 1)
kono
parents:
diff changeset
84 #define make_or_reuse_sat_unsigned_fract_type(P) \
kono
parents:
diff changeset
85 make_or_reuse_fract_type (P, 1, 1)
kono
parents:
diff changeset
86 #define make_or_reuse_signed_accum_type(P) \
kono
parents:
diff changeset
87 make_or_reuse_accum_type (P, 0, 0)
kono
parents:
diff changeset
88 #define make_or_reuse_unsigned_accum_type(P) \
kono
parents:
diff changeset
89 make_or_reuse_accum_type (P, 1, 0)
kono
parents:
diff changeset
90 #define make_or_reuse_sat_signed_accum_type(P) \
kono
parents:
diff changeset
91 make_or_reuse_accum_type (P, 0, 1)
kono
parents:
diff changeset
92 #define make_or_reuse_sat_unsigned_accum_type(P) \
kono
parents:
diff changeset
93 make_or_reuse_accum_type (P, 1, 1)
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 extern tree make_signed_type (int);
kono
parents:
diff changeset
96 extern tree make_unsigned_type (int);
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 /* Return the mode for data of a given size SIZE and mode class CLASS.
kono
parents:
diff changeset
99 If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
kono
parents:
diff changeset
100 The value is BLKmode if no other mode is found. This is like
kono
parents:
diff changeset
101 mode_for_size, but is passed a tree. */
kono
parents:
diff changeset
102 extern opt_machine_mode mode_for_size_tree (const_tree, enum mode_class, int);
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 extern tree bitwise_type_for_mode (machine_mode);
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 /* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
kono
parents:
diff changeset
107 a previous call to layout_decl and calls it again. */
kono
parents:
diff changeset
108 extern void relayout_decl (tree);
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 /* variable_size (EXP) is like save_expr (EXP) except that it
kono
parents:
diff changeset
111 is for the special case of something that is part of a
kono
parents:
diff changeset
112 variable size for a data type. It makes special arrangements
kono
parents:
diff changeset
113 to compute the value at the right time when the data type
kono
parents:
diff changeset
114 belongs to a function parameter. */
kono
parents:
diff changeset
115 extern tree variable_size (tree);
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 #endif // GCC_STOR_LAYOUT_H