summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-consumed-analysis-strict.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Consumed analysis: switch from tests_consumed/unconsumed to a generalDeLesley Hutchins2013-10-111-66/+0
| | | | | | tests_typestate attribute. Patch by chris.wailes@gmail.com. llvm-svn: 192513
* Consumed Analysis: Change callable_when so that it can take a list of statesDeLesley Hutchins2013-10-041-164/+7
| | | | | | | | that a function can be called in. This reduced the total number of annotations needed and makes writing more complicated behaviour less burdensome. Patch by chriswails@gmail.com. llvm-svn: 191983
* Consumed Analysis: The 'consumable' attribute now takes a identifier ↵David Blaikie2013-09-061-10/+10
| | | | | | | | | | | | | specifying the default assumed state for objects of this class This information is used for return states and pass-by-value parameter states. Patch by Chris Wailes. Review by DeLesley Hutchins and Aaron Ballman. llvm-svn: 190116
* Consumed analysis: add return_typestate attribute.DeLesley Hutchins2013-09-031-3/+5
| | | | | | | | | | Patch by chris.wailes@gmail.com Functions can now declare what state the consumable type the are returning will be in. This is then used on the caller side and checked on the callee side. Constructors now use this attribute instead of the 'consumes' attribute. llvm-svn: 189843
* Consumed analysis: add 'consumable' class attribute.DeLesley Hutchins2013-08-301-3/+4
| | | | | | | | | | | | Patch by chris.wailes@gmail.com Adds the 'consumable' attribute that can be attached to classes. This replaces the previous method of scanning a class's methods to see if any of them have consumed analysis attributes attached to them. If consumed analysis attributes are attached to methods of a class that isn't marked 'consumable' a warning is generated. llvm-svn: 189702
* Consumed analysis: track function parameters.DeLesley Hutchins2013-08-291-0/+4
| | | | | | Patch by chris.wailes@gmail.com. llvm-svn: 189616
* Consumed analysis: non-const methods no longer transfer an object into anDeLesley Hutchins2013-08-291-9/+2
| | | | | | unknown state. Patch by chris.wailes@gmail.com. llvm-svn: 189612
* Consumed analysis: improve handling of conditionals.DeLesley Hutchins2013-08-291-21/+121
| | | | | | | | | | | | | | Patch by chris.wailes@gmail.com. * The TestedVarsVisitor was folded into the ConsumedStmtVisitor. * The VarTestResult class was updated to allow these changes. * The PropagationInfo class was updated for the same reasons. * Correctly handle short-circuiting of Boolean operations. * Blocks are now marked as unreachable when we can statically prove we will never branch to them. * Unreachable blocks are skipped by the analysis. llvm-svn: 189594
* Consumed analysis: change class name in test cases.DeLesley Hutchins2013-08-231-20/+20
| | | | | | | The name of a class used in the testing files was updated to actually be descriptive. Patch by chris.wailes@gmail.com. llvm-svn: 189132
* Patch by Chris Wailes <chris.wailes@gmail.com>.DeLesley Hutchins2013-08-121-0/+123
Reviewed by delesley, dblaikie. Add the annotations and code needed to support a basic 'consumed' analysis. Summary: This new analysis is based on academic literature on linear types. It tracks the state of a value, either as unconsumed, consumed, or unknown. Methods are then annotated as CallableWhenUnconsumed, and when an annotated method is called while the value is in the 'consumed' state a warning is issued. A value may be tested in the conditional statement of an if-statement; when this occurs we know the state of the value in the different branches, and this information is added to our analysis. The code is still highly experimental, and the names of annotations or the algorithm may be subject to change. llvm-svn: 188206
OpenPOWER on IntegriCloud