diff options
author | Aaron Puchert <aaronpuchert@alice-dsl.net> | 2020-09-05 15:44:20 +0200 |
---|---|---|
committer | Aaron Puchert <aaronpuchert@alice-dsl.net> | 2020-09-05 17:26:12 +0200 |
commit | 9dcc82f34ea9b623d82d2577b93aaf67d36dabd2 (patch) | |
tree | e1657b4c3ae758804aa8801cc0e115f4f5e79c1a /clang/lib/Analysis/ThreadSafetyCommon.cpp | |
parent | ac87480bd8beef0a4e93981e38df2c21652e1393 (diff) | |
download | llvm-9dcc82f34ea9b623d82d2577b93aaf67d36dabd2.zip llvm-9dcc82f34ea9b623d82d2577b93aaf67d36dabd2.tar.gz llvm-9dcc82f34ea9b623d82d2577b93aaf67d36dabd2.tar.bz2 |
Thread safety analysis: Consider global variables in scope
Instead of just mutex members we also consider mutex globals.
Unsurprisingly they are always in scope. Now the paper [1] says that
> The scope of a class member is assumed to be its enclosing class,
> while the scope of a global variable is the translation unit in
> which it is defined.
But I don't think we should limit this to TUs where a definition is
available - a declaration is enough to acquire the mutex, and if a mutex
is really limited in scope to a translation unit, it should probably be
only declared there.
[1] https://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/42958.pdf
Fixes PR46354.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D84604
Diffstat (limited to 'clang/lib/Analysis/ThreadSafetyCommon.cpp')
0 files changed, 0 insertions, 0 deletions