Commit Graph

35 Commits

Author SHA1 Message Date
DeLesley Hutchins 49979f2e38 Thread safety analysis: implement lock_returned attribute.
llvm-svn: 159152
2012-06-25 18:33:18 +00:00
DeLesley Hutchins ebbf77016d Thread safety analysis: fixes a bug in which locksets are not handled
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.

llvm-svn: 159008
2012-06-22 17:07:28 +00:00
DeLesley Hutchins 8c9d9579c4 Refactor the thread safety analysis so that it is easier to do
path-sensitive analysis like handling of trylock expressions.

llvm-svn: 155137
2012-04-19 16:48:43 +00:00
John McCall 113bee0536 Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context.  I'm amenable to suggestions about the exact meaning
of this bit.

llvm-svn: 152491
2012-03-10 09:33:50 +00:00
DeLesley Hutchins e2a3f75a12 Thread safety analysis: expand set of expressions that can be used to denote locks.
llvm-svn: 151956
2012-03-02 23:36:05 +00:00
DeLesley Hutchins a2587ef26d Thread safety analysis: handle CFG blocks which call functions marked as noreturn.
llvm-svn: 151944
2012-03-02 22:02:58 +00:00
DeLesley Hutchins c2286f6402 Thread-safety analysis: Disable checking inside constructors, destructors, lock, and unlock functions
llvm-svn: 150701
2012-02-16 17:13:43 +00:00
DeLesley Hutchins bc8ffdb68c Thread-Safety: added support for 'this' as a lock expression.
llvm-svn: 150700
2012-02-16 17:03:24 +00:00
Richard Smith 922866783b 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.

llvm-svn: 149669
2012-02-03 04:45:26 +00:00
Richard Smith 815b29d7c9 Thread safety analysis: at a CFG join point between a block terminating in a
'continue' and another block, prefer the lockset from the other block, and
diagnose the 'continue' block as being the end of a loop.

llvm-svn: 149666
2012-02-03 03:30:07 +00:00
DeLesley Hutchins 68f7b1a647 Handle thread safety attributes on functions with separate definitions and declarations.
llvm-svn: 148599
2012-01-20 23:24:41 +00:00
DeLesley Hutchins 9d53033de6 Thread safety analysis: added support for trylock attribute.
llvm-svn: 147672
2012-01-06 19:16:50 +00:00
DeLesley Hutchins 9b7022e570 Added LocalVariableMap
llvm-svn: 147670
2012-01-06 18:36:09 +00:00
DeLesley Hutchins 714296cb31 Support for thread safety attributes on functions
llvm-svn: 147331
2011-12-29 00:56:48 +00:00
DeLesley Hutchins f7faa6a69b This patch extends thread safety analysis with support for the scoped_lockable attribute.
llvm-svn: 146174
2011-12-08 20:23:06 +00:00
Ted Kremenek 81ce1c8a99 Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.
llvm-svn: 142782
2011-10-24 01:32:45 +00:00
Ted Kremenek 4b4c51c323 Refactor ThreadSafety to use PostOrderCFGView instead of its own copy (of TopologicallySortedCFG).
llvm-svn: 142714
2011-10-22 02:14:27 +00:00
DeLesley Hutchins f893e8ab87 Added support for thread safety attributes on destructors.
llvm-svn: 142685
2011-10-21 20:51:27 +00:00
DeLesley Hutchins c20905110a Thread safety analysis refactoring: invalid lock expressions.
llvm-svn: 142666
2011-10-21 18:10:14 +00:00
DeLesley Hutchins db917bdea2 Thread safety analysis: add support for attributes on constructors.
llvm-svn: 142665
2011-10-21 18:06:53 +00:00
DeLesley Hutchins 3d312b175a Refactoring and code cleanup.
llvm-svn: 142654
2011-10-21 16:14:33 +00:00
DeLesley Hutchins 30abeb1680 Substitute for arguments in method calls -- functionality
llvm-svn: 142267
2011-10-17 21:38:02 +00:00
DeLesley Hutchins a088f67bee Substitute for arguments in method calls -- refactoring
llvm-svn: 142260
2011-10-17 21:33:35 +00:00
DeLesley Hutchins 08e094aee3 Test commit
llvm-svn: 140149
2011-09-20 17:25:59 +00:00
Caitlin Sadowski 086fb95da5 Thread safety: Adding FIXMEs and a couple cleanups
llvm-svn: 139894
2011-09-16 00:35:54 +00:00
Caitlin Sadowski 6525fb25cb Thread safety: completeing the implementation of shared/exclusive locks required attributes
llvm-svn: 139804
2011-09-15 17:43:08 +00:00
Caitlin Sadowski af9b7c5f8b Thread safety: refactoring various out of scope warnings to use the same inteface. This eliminates a lot of unnecessary duplicated code.
llvm-svn: 139801
2011-09-15 17:25:19 +00:00
Caitlin Sadowski 5b34a2fd6e Thread safety: adding additional documentation to the main thread safety interface, and making the destructor for the thread safety handler pure virtual
llvm-svn: 139722
2011-09-14 20:05:09 +00:00
Caitlin Sadowski 787c2a1b09 Thread safety: adding test cases for unparseable lock expressions and expanding the handling of these expressions
llvm-svn: 139720
2011-09-14 20:00:24 +00:00
Caitlin Sadowski eecd273951 Thread safety: small formatting change
llvm-svn: 139548
2011-09-12 22:28:41 +00:00
Benjamin Kramer 8a8051f2cd Silence "end of non-void function" warnings with llvm_unreachable and add an assert.
llvm-svn: 139474
2011-09-10 21:52:04 +00:00
Caitlin Sadowski 82e2de512e Thread safety: removing unnecessary import and reordering import list
llvm-svn: 139426
2011-09-09 23:00:59 +00:00
Caitlin Sadowski 0bef2279fb Thread safety: removing unnecessary import
llvm-svn: 139425
2011-09-09 22:49:12 +00:00
Caitlin Sadowski ff2f3f8105 Thread safety: This patch deals with previously unhandled cases when building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions
llvm-svn: 139370
2011-09-09 16:21:55 +00:00
Caitlin Sadowski 33208340bd Thread Safety: Moving the analysis to a new file
llvm-svn: 139369
2011-09-09 16:11:56 +00:00