Commit f516639
committed
[TBAA] Refine pointer-tbaa for void pointers by pointer depth
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 0074a46 commit f516639
File tree
4 files changed
+45
-15
lines changed- clang
- lib/CodeGen
- test
- CXX/drs
- CodeGen
4 files changed
+45
-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 | + | |
83 | 102 | | |
84 | 103 | | |
85 | 104 | | |
| |||
202 | 221 | | |
203 | 222 | | |
204 | 223 | | |
205 | | - | |
206 | 224 | | |
207 | | - | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
232 | 250 | | |
233 | 251 | | |
234 | 252 | | |
235 | | - | |
| 253 | + | |
236 | 254 | | |
237 | 255 | | |
238 | 256 | | |
| |||
256 | 274 | | |
257 | 275 | | |
258 | 276 | | |
259 | | - | |
| 277 | + | |
260 | 278 | | |
261 | 279 | | |
262 | 280 | | |
| |||
270 | 288 | | |
271 | 289 | | |
272 | 290 | | |
273 | | - | |
| 291 | + | |
274 | 292 | | |
275 | 293 | | |
276 | 294 | | |
| |||
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
284 | | - | |
| 302 | + | |
285 | 303 | | |
286 | 304 | | |
287 | 305 | | |
| |||
| 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