diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-03 04:45:26 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-03 04:45:26 +0000 |
commit | 2e5156274b8051217565b557bfa14c80f7990e9c (patch) | |
tree | 300453996c9eabf553db8bd94a4bf611f8cd4b9f /include/clang/Analysis | |
parent | aacde7174af6c5759b52dc0ceb7b167d323afb6a (diff) |
Thread safety analysis:
* When we detect that a CFG block has inconsistent lock sets, point the
diagnostic at the location where we found the inconsistency, and point a note
at somewhere the inconsistently-locked mutex was locked.
* Fix the wording of the normal (non-loop, non-end-of-function) case of this
diagnostic to not suggest that the mutex is going out of scope.
* Fix the diagnostic emission code to keep a warning and its note together when
sorting the diagnostics into source location order.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis')
-rw-r--r-- | include/clang/Analysis/Analyses/ThreadSafety.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/clang/Analysis/Analyses/ThreadSafety.h b/include/clang/Analysis/Analyses/ThreadSafety.h index 6988ec06a8..26e258d64a 100644 --- a/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/include/clang/Analysis/Analyses/ThreadSafety.h @@ -93,10 +93,14 @@ public: /// 3. or when a mutex is locked but not unlocked inside a function. /// \param LockName -- A StringRef name for the lock expression, to be printed /// in the error message. - /// \param Loc -- The location of the lock expression where the mutex is + /// \param LocLocked -- The location of the lock expression where the mutex is /// locked + /// \param LocEndOfScope -- The location of the end of the scope where the + /// mutex is no longer held /// \param LEK -- which of the three above cases we should warn for - virtual void handleMutexHeldEndOfScope(Name LockName, SourceLocation Loc, + virtual void handleMutexHeldEndOfScope(Name LockName, + SourceLocation LocLocked, + SourceLocation LocEndOfScope, LockErrorKind LEK){} /// Warn when a mutex is held exclusively and shared at the same point. For |