annotate gcc/tree-ssanames.h @ 115:4cb7a319550d

fix c-parser.c
author mir3636
date Tue, 28 Nov 2017 19:31:15 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* SSA name expresssons routines
kono
parents:
diff changeset
2 Copyright (C) 2013-2017 Free Software Foundation, Inc.
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_TREE_SSANAMES_H
kono
parents:
diff changeset
21 #define GCC_TREE_SSANAMES_H
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* Aliasing information for SSA_NAMEs representing pointer variables. */
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 struct GTY(()) ptr_info_def
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 /* The points-to solution. */
kono
parents:
diff changeset
28 struct pt_solution pt;
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* Alignment and misalignment of the pointer in bytes. Together
kono
parents:
diff changeset
31 align and misalign specify low known bits of the pointer.
kono
parents:
diff changeset
32 ptr & (align - 1) == misalign. */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* When known, this is the power-of-two byte alignment of the object this
kono
parents:
diff changeset
35 pointer points into. This is usually DECL_ALIGN_UNIT for decls and
kono
parents:
diff changeset
36 MALLOC_ABI_ALIGNMENT for allocated storage. When the alignment is not
kono
parents:
diff changeset
37 known, it is zero. Do not access directly but use functions
kono
parents:
diff changeset
38 get_ptr_info_alignment, set_ptr_info_alignment,
kono
parents:
diff changeset
39 mark_ptr_info_alignment_unknown and similar. */
kono
parents:
diff changeset
40 unsigned int align;
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 /* When alignment is known, the byte offset this pointer differs from the
kono
parents:
diff changeset
43 above alignment. Access only through the same helper functions as align
kono
parents:
diff changeset
44 above. */
kono
parents:
diff changeset
45 unsigned int misalign;
kono
parents:
diff changeset
46 };
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 /* Value range information for SSA_NAMEs representing non-pointer variables. */
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 struct GTY ((variable_size)) range_info_def {
kono
parents:
diff changeset
51 /* Minimum, maximum and nonzero bits. */
kono
parents:
diff changeset
52 TRAILING_WIDE_INT_ACCESSOR (min, ints, 0)
kono
parents:
diff changeset
53 TRAILING_WIDE_INT_ACCESSOR (max, ints, 1)
kono
parents:
diff changeset
54 TRAILING_WIDE_INT_ACCESSOR (nonzero_bits, ints, 2)
kono
parents:
diff changeset
55 trailing_wide_ints <3> ints;
kono
parents:
diff changeset
56 };
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 #define SSANAMES(fun) (fun)->gimple_df->ssa_names
kono
parents:
diff changeset
60 #define DEFAULT_DEFS(fun) (fun)->gimple_df->default_defs
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 #define num_ssa_names (vec_safe_length (cfun->gimple_df->ssa_names))
kono
parents:
diff changeset
63 #define ssa_name(i) ((*cfun->gimple_df->ssa_names)[(i)])
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 #define FOR_EACH_SSA_NAME(I, VAR, FN) \
kono
parents:
diff changeset
66 for (I = 1; SSANAMES (FN)->iterate (I, &VAR); ++I) \
kono
parents:
diff changeset
67 if (VAR)
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 /* Sets the value range to SSA. */
kono
parents:
diff changeset
70 extern void set_range_info (tree, enum value_range_type, const wide_int_ref &,
kono
parents:
diff changeset
71 const wide_int_ref &);
kono
parents:
diff changeset
72 extern void set_range_info_raw (tree, enum value_range_type,
kono
parents:
diff changeset
73 const wide_int_ref &,
kono
parents:
diff changeset
74 const wide_int_ref &);
kono
parents:
diff changeset
75 /* Gets the value range from SSA. */
kono
parents:
diff changeset
76 extern enum value_range_type get_range_info (const_tree, wide_int *,
kono
parents:
diff changeset
77 wide_int *);
kono
parents:
diff changeset
78 extern void set_nonzero_bits (tree, const wide_int_ref &);
kono
parents:
diff changeset
79 extern wide_int get_nonzero_bits (const_tree);
kono
parents:
diff changeset
80 extern bool ssa_name_has_boolean_range (tree);
kono
parents:
diff changeset
81 extern void init_ssanames (struct function *, int);
kono
parents:
diff changeset
82 extern void fini_ssanames (struct function *);
kono
parents:
diff changeset
83 extern void ssanames_print_statistics (void);
kono
parents:
diff changeset
84 extern tree make_ssa_name_fn (struct function *, tree, gimple *,
kono
parents:
diff changeset
85 unsigned int version = 0);
kono
parents:
diff changeset
86 extern void release_ssa_name_fn (struct function *, tree);
kono
parents:
diff changeset
87 extern bool get_ptr_info_alignment (struct ptr_info_def *, unsigned int *,
kono
parents:
diff changeset
88 unsigned int *);
kono
parents:
diff changeset
89 extern void mark_ptr_info_alignment_unknown (struct ptr_info_def *);
kono
parents:
diff changeset
90 extern void set_ptr_info_alignment (struct ptr_info_def *, unsigned int,
kono
parents:
diff changeset
91 unsigned int);
kono
parents:
diff changeset
92 extern void adjust_ptr_info_misalignment (struct ptr_info_def *,
kono
parents:
diff changeset
93 unsigned int);
kono
parents:
diff changeset
94 extern struct ptr_info_def *get_ptr_info (tree);
kono
parents:
diff changeset
95 extern void set_ptr_nonnull (tree);
kono
parents:
diff changeset
96 extern bool get_ptr_nonnull (const_tree);
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 extern tree copy_ssa_name_fn (struct function *, tree, gimple *);
kono
parents:
diff changeset
99 extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
kono
parents:
diff changeset
100 extern tree duplicate_ssa_name_fn (struct function *, tree, gimple *);
kono
parents:
diff changeset
101 extern void duplicate_ssa_name_range_info (tree, enum value_range_type,
kono
parents:
diff changeset
102 struct range_info_def *);
kono
parents:
diff changeset
103 extern void reset_flow_sensitive_info (tree);
kono
parents:
diff changeset
104 extern void reset_flow_sensitive_info_in_bb (basic_block);
kono
parents:
diff changeset
105 extern void release_defs (gimple *);
kono
parents:
diff changeset
106 extern void replace_ssa_name_symbol (tree, tree);
kono
parents:
diff changeset
107 extern void flush_ssaname_freelist (void);
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 /* Return an SSA_NAME node for variable VAR defined in statement STMT
kono
parents:
diff changeset
111 in function cfun. */
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 static inline tree
kono
parents:
diff changeset
114 make_ssa_name (tree var, gimple *stmt = NULL)
kono
parents:
diff changeset
115 {
kono
parents:
diff changeset
116 return make_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
117 }
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 /* Return an SSA_NAME node using the template SSA name NAME defined in
kono
parents:
diff changeset
120 statement STMT in function cfun. */
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 static inline tree
kono
parents:
diff changeset
123 copy_ssa_name (tree var, gimple *stmt = NULL)
kono
parents:
diff changeset
124 {
kono
parents:
diff changeset
125 return copy_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
126 }
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 /* Creates a duplicate of a SSA name NAME tobe defined by statement STMT
kono
parents:
diff changeset
129 in function cfun. */
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 static inline tree
kono
parents:
diff changeset
132 duplicate_ssa_name (tree var, gimple *stmt)
kono
parents:
diff changeset
133 {
kono
parents:
diff changeset
134 return duplicate_ssa_name_fn (cfun, var, stmt);
kono
parents:
diff changeset
135 }
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 /* Release the SSA name NAME used in function cfun. */
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 static inline void
kono
parents:
diff changeset
140 release_ssa_name (tree name)
kono
parents:
diff changeset
141 {
kono
parents:
diff changeset
142 release_ssa_name_fn (cfun, name);
kono
parents:
diff changeset
143 }
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 /* Return an anonymous SSA_NAME node for type TYPE defined in statement STMT
kono
parents:
diff changeset
146 in function cfun. Arrange so that it uses NAME in dumps. */
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 static inline tree
kono
parents:
diff changeset
149 make_temp_ssa_name (tree type, gimple *stmt, const char *name)
kono
parents:
diff changeset
150 {
kono
parents:
diff changeset
151 tree ssa_name;
kono
parents:
diff changeset
152 gcc_checking_assert (TYPE_P (type));
kono
parents:
diff changeset
153 ssa_name = make_ssa_name_fn (cfun, type, stmt);
kono
parents:
diff changeset
154 SET_SSA_NAME_VAR_OR_IDENTIFIER (ssa_name, get_identifier (name));
kono
parents:
diff changeset
155 return ssa_name;
kono
parents:
diff changeset
156 }
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 #endif /* GCC_TREE_SSANAMES_H */