aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDan McArdle <zingermc@gmail.com>2024-06-24 09:29:13 -0400
committerGitHub <noreply@github.com>2024-06-24 09:29:13 -0400
commitc1bde0a2cb640b3607e9568b9a57b292e1f82666 (patch)
tree9fff28900c6e0fb1b94877418d69cb006bd0e6ac /clang/lib/CodeGen/CodeGenFunction.cpp
parent5cd0ba30f53d11835dbfd05ad4071d397387fb04 (diff)
downloadllvm-c1bde0a2cb640b3607e9568b9a57b292e1f82666.zip
llvm-c1bde0a2cb640b3607e9568b9a57b292e1f82666.tar.gz
llvm-c1bde0a2cb640b3607e9568b9a57b292e1f82666.tar.bz2
[clang][ThreadSafety] Check trylock function success and return types (#95290)
With this change, Clang will generate errors when trylock functions have improper return types. Today, it silently fails to apply the trylock attribute to these functions which may incorrectly lead users to believe they have correctly acquired locks before accessing guarded data. As a side effect of explicitly checking the success argument type, I seem to have fixed a false negative in the analysis that could occur when a trylock's success argument is an enumerator. I've added a regression test to warn-thread-safety-analysis.cpp named `TrylockSuccessEnumFalseNegative`. This change also improves the documentation with descriptions of of the subtle gotchas that arise from the analysis interpreting the success arg as a boolean. Issue #92408
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions