annotate gcc/valtrack.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Infrastructure for tracking user variable locations and values
kono
parents:
diff changeset
2 throughout compilation.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 2010-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4 Contributed by Alexandre Oliva <aoliva@redhat.com>.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GCC_VALTRACK_H
kono
parents:
diff changeset
23 #define GCC_VALTRACK_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 /* Debug uses of dead regs. */
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 /* Entry that maps a dead pseudo (REG) used in a debug insns that dies
kono
parents:
diff changeset
28 at different blocks to the debug temp (DTEMP) it was replaced
kono
parents:
diff changeset
29 with. */
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 struct dead_debug_global_entry
kono
parents:
diff changeset
32 {
kono
parents:
diff changeset
33 rtx reg;
kono
parents:
diff changeset
34 rtx dtemp;
kono
parents:
diff changeset
35 };
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* Descriptor for hash_table to hash by dead_debug_global_entry's REG
kono
parents:
diff changeset
38 and map to DTEMP. */
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 struct dead_debug_hash_descr : free_ptr_hash <dead_debug_global_entry>
kono
parents:
diff changeset
41 {
kono
parents:
diff changeset
42 /* Hash on the pseudo number. */
kono
parents:
diff changeset
43 static inline hashval_t hash (const dead_debug_global_entry *my);
kono
parents:
diff changeset
44 /* Entries are identical if they refer to the same pseudo. */
kono
parents:
diff changeset
45 static inline bool equal (const dead_debug_global_entry *my,
kono
parents:
diff changeset
46 const dead_debug_global_entry *other);
kono
parents:
diff changeset
47 };
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 /* Hash on the pseudo number. */
kono
parents:
diff changeset
50 inline hashval_t
kono
parents:
diff changeset
51 dead_debug_hash_descr::hash (const dead_debug_global_entry *my)
kono
parents:
diff changeset
52 {
kono
parents:
diff changeset
53 return REGNO (my->reg);
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* Entries are identical if they refer to the same pseudo. */
kono
parents:
diff changeset
57 inline bool
kono
parents:
diff changeset
58 dead_debug_hash_descr::equal (const dead_debug_global_entry *my,
kono
parents:
diff changeset
59 const dead_debug_global_entry *other)
kono
parents:
diff changeset
60 {
kono
parents:
diff changeset
61 return my->reg == other->reg;
kono
parents:
diff changeset
62 }
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 /* Maintain a global table of pseudos used in debug insns after their
kono
parents:
diff changeset
65 deaths in other blocks, and debug temps their deathpoint values are
kono
parents:
diff changeset
66 to be bound to. */
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 struct dead_debug_global
kono
parents:
diff changeset
69 {
kono
parents:
diff changeset
70 /* This hash table that maps pseudos to debug temps. */
kono
parents:
diff changeset
71 hash_table<dead_debug_hash_descr> *htab;
kono
parents:
diff changeset
72 /* For each entry in htab, the bit corresponding to its REGNO will
kono
parents:
diff changeset
73 be set. */
kono
parents:
diff changeset
74 bitmap used;
kono
parents:
diff changeset
75 };
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 /* Node of a linked list of uses of dead REGs in debug insns. */
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 struct dead_debug_use
kono
parents:
diff changeset
80 {
kono
parents:
diff changeset
81 df_ref use;
kono
parents:
diff changeset
82 struct dead_debug_use *next;
kono
parents:
diff changeset
83 };
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 /* Linked list of the above, with a bitmap of the REGs in the
kono
parents:
diff changeset
86 list. */
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 struct dead_debug_local
kono
parents:
diff changeset
89 {
kono
parents:
diff changeset
90 /* The first dead_debug_use entry in the list. */
kono
parents:
diff changeset
91 struct dead_debug_use *head;
kono
parents:
diff changeset
92 /* A pointer to the global tracking data structure. */
kono
parents:
diff changeset
93 struct dead_debug_global *global;
kono
parents:
diff changeset
94 /* A bitmap that has bits set for each REG used in the
kono
parents:
diff changeset
95 dead_debug_use list, and for each entry in the global hash
kono
parents:
diff changeset
96 table. */
kono
parents:
diff changeset
97 bitmap used;
kono
parents:
diff changeset
98 /* A bitmap that has bits set for each INSN that is to be
kono
parents:
diff changeset
99 rescanned. */
kono
parents:
diff changeset
100 bitmap to_rescan;
kono
parents:
diff changeset
101 };
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 /* This type controls the behavior of dead_debug_insert_temp WRT
kono
parents:
diff changeset
104 UREGNO and INSN. */
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 enum debug_temp_where
kono
parents:
diff changeset
107 {
kono
parents:
diff changeset
108 /* Bind a newly-created debug temporary to a REG for UREGNO, and
kono
parents:
diff changeset
109 insert the debug insn before INSN. REG is expected to die at
kono
parents:
diff changeset
110 INSN. */
kono
parents:
diff changeset
111 DEBUG_TEMP_BEFORE_WITH_REG = -1,
kono
parents:
diff changeset
112 /* Bind a newly-created debug temporary to the value INSN stores
kono
parents:
diff changeset
113 in REG, and insert the debug insn before INSN. */
kono
parents:
diff changeset
114 DEBUG_TEMP_BEFORE_WITH_VALUE = 0,
kono
parents:
diff changeset
115 /* Bind a newly-created debug temporary to a REG for UREGNO, and
kono
parents:
diff changeset
116 insert the debug insn after INSN. REG is expected to be set at
kono
parents:
diff changeset
117 INSN. */
kono
parents:
diff changeset
118 DEBUG_TEMP_AFTER_WITH_REG = 1,
kono
parents:
diff changeset
119 /* Like DEBUG_TEMP_AFTER_WITH_REG, but force addition of a debug
kono
parents:
diff changeset
120 temporary even if there is just a single debug use. This is used
kono
parents:
diff changeset
121 on regs that are becoming REG_DEAD on INSN and so uses of the
kono
parents:
diff changeset
122 reg later on are invalid. */
kono
parents:
diff changeset
123 DEBUG_TEMP_AFTER_WITH_REG_FORCE = 2
kono
parents:
diff changeset
124 };
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 extern void dead_debug_global_init (struct dead_debug_global *, bitmap);
kono
parents:
diff changeset
127 extern void dead_debug_global_finish (struct dead_debug_global *, bitmap);
kono
parents:
diff changeset
128 extern void dead_debug_local_init (struct dead_debug_local *, bitmap,
kono
parents:
diff changeset
129 struct dead_debug_global *);
kono
parents:
diff changeset
130 extern void dead_debug_local_finish (struct dead_debug_local *, bitmap);
kono
parents:
diff changeset
131 extern void dead_debug_add (struct dead_debug_local *, df_ref, unsigned int);
kono
parents:
diff changeset
132 extern int dead_debug_insert_temp (struct dead_debug_local *,
kono
parents:
diff changeset
133 unsigned int uregno, rtx_insn *insn,
kono
parents:
diff changeset
134 enum debug_temp_where);
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 extern void propagate_for_debug (rtx_insn *, rtx_insn *, rtx, rtx, basic_block);
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 #endif /* GCC_VALTRACK_H */