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/Basic | |
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/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index b94b38007a..394f8b089d 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1642,12 +1642,13 @@ def warn_no_unlock : Warning< "mutex '%0' is still locked at the end of function">, InGroup<ThreadSafety>, DefaultIgnore; // FIXME: improve the error message about locks not in scope -def warn_lock_at_end_of_scope : Warning< - "mutex '%0' is still locked at the end of its scope">, +def warn_lock_some_predecessors : Warning< + "mutex '%0' is not locked on every path through here">, InGroup<ThreadSafety>, DefaultIgnore; def warn_expecting_lock_held_on_loop : Warning< "expecting mutex '%0' to be locked at start of each loop">, InGroup<ThreadSafety>, DefaultIgnore; +def note_locked_here : Note<"mutex acquired here">; def warn_lock_exclusive_and_shared : Warning< "mutex '%0' is locked exclusively and shared in the same scope">, InGroup<ThreadSafety>, DefaultIgnore; |