This repository was archived by the owner on Sep 15, 2025. It is now read-only.
Commit c1e7e45
Thread Safety Analysis: Support passing scoped locks between functions with appropriate annotations (llvm#110523)
This is helpful when multiple functions operate on the same
capabilities, but we still want to use scoped lockable types for
readability and exception safety.
- Introduce support for thread safety annotations on function parameters
marked with the 'scoped_lockable' attribute.
- Add semantic checks for annotated function parameters, ensuring
correct usage.
- Enhance the analysis to recognize and handle parameters annotated for
thread safety, extending the scope of analysis to track these across
function boundries.
- Verify that the underlying mutexes of function arguments match the
expectations set by the annotations.
Limitation: This does not work when the attribute arguments are class
members, because attributes on function parameters are parsed
differently from attributes on functions.1 parent 415cfaf commit c1e7e45
File tree
10 files changed
+774
-30
lines changed- clang
- docs
- include/clang
- Analysis/Analyses
- Basic
- lib
- Analysis
- Sema
- test/SemaCXX
10 files changed
+774
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
711 | 736 | | |
712 | 737 | | |
713 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
211 | 214 | | |
212 | 215 | | |
213 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
214 | 231 | | |
215 | 232 | | |
216 | 233 | | |
217 | 234 | | |
218 | 235 | | |
219 | 236 | | |
220 | 237 | | |
221 | | - | |
222 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
223 | 241 | | |
224 | 242 | | |
| 243 | + | |
| 244 | + | |
225 | 245 | | |
226 | 246 | | |
227 | 247 | | |
| |||
249 | 269 | | |
250 | 270 | | |
251 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
252 | 280 | | |
253 | 281 | | |
254 | 282 | | |
| |||
283 | 311 | | |
284 | 312 | | |
285 | 313 | | |
286 | | - | |
| 314 | + | |
| 315 | + | |
287 | 316 | | |
288 | 317 | | |
289 | 318 | | |
| 319 | + | |
| 320 | + | |
290 | 321 | | |
291 | 322 | | |
292 | 323 | | |
| |||
305 | 336 | | |
306 | 337 | | |
307 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
308 | 349 | | |
309 | 350 | | |
310 | 351 | | |
| |||
393 | 434 | | |
394 | 435 | | |
395 | 436 | | |
| 437 | + | |
396 | 438 | | |
397 | 439 | | |
398 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
226 | 262 | | |
227 | 263 | | |
228 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3763 | 3763 | | |
3764 | 3764 | | |
3765 | 3765 | | |
3766 | | - | |
| 3766 | + | |
3767 | 3767 | | |
3768 | 3768 | | |
3769 | 3769 | | |
| |||
3795 | 3795 | | |
3796 | 3796 | | |
3797 | 3797 | | |
3798 | | - | |
| 3798 | + | |
3799 | 3799 | | |
3800 | 3800 | | |
3801 | 3801 | | |
| |||
3819 | 3819 | | |
3820 | 3820 | | |
3821 | 3821 | | |
3822 | | - | |
| 3822 | + | |
3823 | 3823 | | |
3824 | 3824 | | |
3825 | 3825 | | |
| |||
3941 | 3941 | | |
3942 | 3942 | | |
3943 | 3943 | | |
3944 | | - | |
| 3944 | + | |
3945 | 3945 | | |
3946 | 3946 | | |
3947 | 3947 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3999 | 3999 | | |
4000 | 4000 | | |
4001 | 4001 | | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
4002 | 4006 | | |
4003 | 4007 | | |
4004 | 4008 | | |
| |||
4054 | 4058 | | |
4055 | 4059 | | |
4056 | 4060 | | |
| 4061 | + | |
| 4062 | + | |
| 4063 | + | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
4057 | 4072 | | |
4058 | 4073 | | |
4059 | 4074 | | |
| |||
0 commit comments