Commit 458b1e9
authored
[TBAA] Refine pointer-tbaa for void pointers by pointer depth (#126047)
Commit 77d3f8a avoids distinct tags for any pointers where the ultimate
pointee type is `void`, to solve breakage in real-world code that uses
(indirections to) `void*` for polymorphism over different pointer types.
While this matches the TBAA implementation in GCC, this patch implements
a refinement that distinguishes void pointers by pointer depth, as
described in the "strict aliasing" documentation included in the
aforementioned commit:
> `void*` is permitted to alias any pointer type, `void**` is permitted
> to alias any pointer to pointer type, and so on.
For example, `void**` is no longer considered to alias `int*` in this
refinement, but it remains possible to use `void**` for polymorphism
over pointers to pointers.1 parent 9855d76 commit 458b1e9
File tree
4 files changed
+62
-15
lines changed- clang
- lib/CodeGen
- test
- CXX/drs
- CodeGen
4 files changed
+62
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 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 | + | |
83 | 119 | | |
84 | 120 | | |
85 | 121 | | |
| |||
202 | 238 | | |
203 | 239 | | |
204 | 240 | | |
205 | | - | |
206 | 241 | | |
207 | | - | |
| 242 | + | |
208 | 243 | | |
209 | 244 | | |
210 | 245 | | |
| |||
232 | 267 | | |
233 | 268 | | |
234 | 269 | | |
235 | | - | |
| 270 | + | |
236 | 271 | | |
237 | 272 | | |
238 | 273 | | |
| |||
256 | 291 | | |
257 | 292 | | |
258 | 293 | | |
259 | | - | |
| 294 | + | |
260 | 295 | | |
261 | 296 | | |
262 | 297 | | |
| |||
270 | 305 | | |
271 | 306 | | |
272 | 307 | | |
273 | | - | |
| 308 | + | |
274 | 309 | | |
275 | 310 | | |
276 | 311 | | |
| |||
281 | 316 | | |
282 | 317 | | |
283 | 318 | | |
284 | | - | |
| 319 | + | |
285 | 320 | | |
286 | 321 | | |
287 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
| 226 | + | |
224 | 227 | | |
225 | 228 | | |
226 | 229 | | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | | - | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | | - | |
| 237 | + | |
| 238 | + | |
234 | 239 | | |
235 | | - | |
| 240 | + | |
236 | 241 | | |
237 | | - | |
| 242 | + | |
238 | 243 | | |
239 | 244 | | |
240 | 245 | | |
241 | | - | |
| 246 | + | |
242 | 247 | | |
243 | 248 | | |
244 | 249 | | |
| |||
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
| 259 | + | |
0 commit comments