summaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-thread-safety-analysis.cpp
Commit message (Collapse)AuthorAge
* Updating the capability attribute diagnostics to be more capability-neutral. ↵Aaron Ballman2014-04-01
| | | | | | Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205359 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread Safety Analysis: new test case for lambdasDeLesley Hutchins2014-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203720 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: handle duplicate assert_lock attributes.DeLesley Hutchins2014-01-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199949 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing some unneeded code, and a diagnostic that was obsoleted. The type ↵Aaron Ballman2013-12-26
| | | | | | | | has already been determined to be a ValueDecl by virtue of the attribute subjects. Added some test case coverage as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198046 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: fix ICE due to missing null check on dyn_cast.DeLesley Hutchins2013-11-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195777 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: check guarded_by and pt_guarded_by on array access.DeLesley Hutchins2013-11-08
| | | | | | Currently supported only with -Wthread-safety-beta. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194275 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: minor bugfix to smart pointer handling, and expandedDeLesley Hutchins2013-11-06
| | | | | | test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194157 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: check pt_guarded_by attribute when calling -> and *DeLesley Hutchins2013-11-05
| | | | | | on smart pointers. -Wthread-safety-beta only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194103 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: new test caseDeLesley Hutchins2013-08-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188571 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread Safety Analysis: fix bug when using TryLock with && and || expressions.DeLesley Hutchins2013-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188505 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: add two new attributes to the thread safety analysis:DeLesley Hutchins2013-05-17
| | | | | | | assert_exclusive_lock and assert_shared_lock. These attributes are used to mark functions that dynamically check (i.e. assert) that a lock is held. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182170 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: turn on checking within lock and unlock functions.DeLesley Hutchins2013-04-08
| | | | | | These checks are enabled with the -Wthread-safety-beta flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179046 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: make sure that expressions in attributes are parsedDeLesley Hutchins2013-02-07
| | | | | | in an unevaluated context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174644 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: ignore edges from throw expressions in CFG.DeLesley Hutchins2013-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172858 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: check member access on guarded non-primitive types.DeLesley Hutchins2012-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169669 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: check locks on method calls, operator=, andDeLesley Hutchins2012-12-05
| | | | | | copy constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169350 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: support multiple thread-safety attributes onDeLesley Hutchins2012-10-12
| | | | | | declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165826 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: allow attributes on constructors to refer to 'this'.DeLesley Hutchins2012-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165339 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix template instantiation of attributes. More specifically, fix the caseDeLesley Hutchins2012-09-26
| | | | | | | | | where an attribute is attached to a forward declaration of a template function, and refers to parameters of that declaration, but is then inherited by the definition of that function. When the definition is instantiated, the parameter references need to be remapped. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164710 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: better handling of unreachable blocks. Fixes a bugDeLesley Hutchins2012-09-21
| | | | | | | where a call to function marked 'noreturn' is followed by unreachable implicit destructor calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164394 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: fix bug where shared trylock was treatedDeLesley Hutchins2012-09-20
| | | | | | as exclusive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164332 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: properly canonicalize calls to virtual methods withinDeLesley Hutchins2012-09-20
| | | | | | lock expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164324 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: Fix warning when EXCLUSIVE_LOCKS_REQUIREDDeLesley Hutchins2012-09-19
| | | | | | is placed on a function that has no path to the exit block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164244 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED orDeLesley Hutchins2012-09-19
| | | | | | | LOCKS_EXCLUDED is used on a method with a name that is is not a simple identifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164242 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: fix bug in expression matching code.DeLesley Hutchins2012-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163656 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: fix bug related to lock_returned attributeDeLesley Hutchins2012-09-11
| | | | | | on templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163642 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: differentiate between two forms of analysis; a preciseDeLesley Hutchins2012-09-10
| | | | | | | | | analysis that may give false positives because it is confused by aliasing, and a less precise analysis that has fewer false positives, but may have false negatives. The more precise warnings are enabled by -Wthread-safety-precise. An additional note clarify the warnings in the precise case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163537 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.Chad Rosier2012-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163404 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: Add support for selectively turning off warningsDeLesley Hutchins2012-09-07
| | | | | | within part of a particular method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163397 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: bugfix for case where a trylock occurs in anDeLesley Hutchins2012-09-05
| | | | | | expression involving temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163237 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: fix handling of LOCK_RETURNED attribute so that theDeLesley Hutchins2012-08-31
| | | | | | latest definition of a function is always used when computing lock expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163028 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: fix handling of string constants in mutexDeLesley Hutchins2012-08-31
| | | | | | expressions, which should be ignored right now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163026 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety-analysis: adds existential quantification over lockDeLesley Hutchins2012-08-10
| | | | | | | expressions. The syntax &MyClass::mutex is interpreted as a pattern that matches m->mutex for any object m of type MyClass. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161691 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: refactor to support more sophisticated handlingDeLesley Hutchins2012-08-10
| | | | | | of expressions, and better error messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161690 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some minor typosSylvestre Ledru2012-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161036 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: impove handling of trylock expressions.DeLesley Hutchins2012-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160018 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread-safety analysis: eliminate false positives in case where the definitionDeLesley Hutchins2012-07-05
| | | | | | | duplicates attributes on the declaration. Also eliminates a false negative in ReleasableMutexLock. Fixing this bug required some refactoring. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159780 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: improve handling of smart pointers.DeLesley Hutchins2012-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159679 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread Safety Analysis: handle expressions involving temporaries,DeLesley Hutchins2012-07-03
| | | | | | e.g. ExprWithCleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159674 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: fixed bug that occurs when very silly peopleDeLesley Hutchins2012-07-02
| | | | | | | use scoped_lockable without putting unlock_function on the destructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159609 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: fixed incorrect error message at the end of a ↵DeLesley Hutchins2012-07-02
| | | | | | locks_required function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159607 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: don't warn in case of duplicate annotation.DeLesley Hutchins2012-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159606 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread Safety Analysis: turn off checking within trylock functions.DeLesley Hutchins2012-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159601 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: support release() function on scopedDeLesley Hutchins2012-06-28
| | | | | | lockable objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159387 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: implement lock_returned attribute.DeLesley Hutchins2012-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159152 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: fixes a bug in which locksets are not handledDeLesley Hutchins2012-06-22
| | | | | | | | properly if there is a join point in the control flow graph that involves a trylock. Also changes the source locations of some warnings to be more consistent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159008 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -Wc++98-compat warning for an outrageously-rare circumstance of 'this'Richard Smith2012-04-30
| | | | | | | | | | | being used in an exception specification in a way which isn't otherwise ill-formed in C++98: this warning also incorrectly triggered on uses of 'this' inside thread-safety attributes, and the mechanism required to tell these cases apart is more complex than can be justified by the (minimal) value of this part of -Wc++98-compat. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155857 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable warn_impcast_literal_float_to_integer by default.David Blaikie2012-04-05
| | | | | | | | | | | | | | | | | This diagnostic seems to be production ready, it's just an oversight that it wasn't turned on by default. The test changes are a bit of a mixed bag. Some tests that seemed like they clearly didn't need to use this behavior have been modified not to use it. Others that I couldn't be sure about, I added the necessary expected-warnings to. It's possible the diagnostic message could be improved to make it clearer that this warning can be suppressed by using a value that won't lose precision when converted to the target type (but can still be a floating point literal, such as "bool b = 1.0;"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154068 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread safety analysis: expand set of expressions that can be used to denote ↵DeLesley Hutchins2012-03-02
| | | | | | locks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151956 91177308-0d34-0410-b5e6-96231b3b80d8
* Issue warning when late-parsed attributes have no declaration.DeLesley Hutchins2012-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151947 91177308-0d34-0410-b5e6-96231b3b80d8