Commit 2d31d33
committed
Thread Safety Analysis: Support reentrant capabilities
Introduce the `reentrant_capability` attribute, which may be specified
alongside the `capability(..)` attribute to denote that the defined
capability type is reentrant. Marking a capability as reentrant means
that acquiring the same capability multiple times is safe, and does not
produce warnings on attempted re-acquisition.
The most significant changes required are plumbing to propagate if the
attribute is present to a CapabilityExpr, and then introducing a
ReentrancyCount to FactEntry that can be incremented while a fact
remains in the FactSet.1 parent 5bdf60d commit 2d31d33
File tree
16 files changed
+598
-75
lines changed- clang
- docs
- include/clang
- Analysis/Analyses
- Basic
- lib
- Analysis
- Sema
- test
- Misc
- SemaCXX
- Sema
- unittests/AST
16 files changed
+598
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
437 | 452 | | |
438 | 453 | | |
439 | 454 | | |
| |||
846 | 861 | | |
847 | 862 | | |
848 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
849 | 867 | | |
850 | 868 | | |
851 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 97 | | |
| 98 | + | |
104 | 99 | | |
| 100 | + | |
105 | 101 | | |
| 102 | + | |
106 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | | - | |
| 279 | + | |
278 | 280 | | |
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | | - | |
285 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
286 | 290 | | |
287 | 291 | | |
288 | | - | |
| 292 | + | |
| 293 | + | |
289 | 294 | | |
290 | 295 | | |
291 | 296 | | |
292 | 297 | | |
| 298 | + | |
293 | 299 | | |
294 | 300 | | |
295 | | - | |
| 301 | + | |
| 302 | + | |
296 | 303 | | |
297 | 304 | | |
298 | 305 | | |
| |||
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | 399 | | |
397 | 400 | | |
398 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4011 | 4011 | | |
4012 | 4012 | | |
4013 | 4013 | | |
| 4014 | + | |
| 4015 | + | |
| 4016 | + | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
| 4020 | + | |
4014 | 4021 | | |
4015 | 4022 | | |
4016 | 4023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4048 | 4048 | | |
4049 | 4049 | | |
4050 | 4050 | | |
| 4051 | + | |
| 4052 | + | |
| 4053 | + | |
4051 | 4054 | | |
4052 | 4055 | | |
4053 | 4056 | | |
| |||
4076 | 4079 | | |
4077 | 4080 | | |
4078 | 4081 | | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
4079 | 4085 | | |
4080 | 4086 | | |
4081 | 4087 | | |
| |||
0 commit comments