Commit 40b82e4
committed
[Syntax] Workaround for 'cannot bypass resilience' warnings
`RawSyntaxArena` and `SyntaxDataaArena` have properties with types from
`_SwiftSyntaxCShims` which is `@_implementationOnly` when compiling with
'-enable-library-evolution`.
But for `-allow-non-resilient-access` for the package cross module
optimizations, they causes warnings:
```
warning: cannot bypass resilience due to member deserialization failure while attempting to access member 'mutex' of 'SyntaxDataArena' in module 'SwiftSyntax' from module 'SwiftSyntax'
warning: cannot bypass resilience due to member deserialization failure while attempting to access member 'hasParent' of 'RawSyntaxArena' in module 'SwiftSyntax' from module 'SwiftSyntax'
```
and non-resilient-access are disabled for these types.
To workaround that, use `UnsafeRawPointer` for those stored properties
and use casting methods to access the actual types.
Note the using computed properties were not enough to silience the
warnings.1 parent ee01462 commit 40b82e4
2 files changed
+18
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
78 | | - | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
156 | | - | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
299 | 303 | | |
300 | 304 | | |
301 | 305 | | |
302 | | - | |
| 306 | + | |
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
307 | | - | |
| 311 | + | |
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
| |||
396 | 399 | | |
397 | 400 | | |
398 | 401 | | |
399 | | - | |
| 402 | + | |
400 | 403 | | |
401 | 404 | | |
402 | 405 | | |
| |||
405 | 408 | | |
406 | 409 | | |
407 | 410 | | |
408 | | - | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
| |||
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | | - | |
435 | | - | |
| 437 | + | |
| 438 | + | |
436 | 439 | | |
437 | 440 | | |
438 | 441 | | |
| |||
0 commit comments