summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-consumed-parsing.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-261-6/+6
| | | | | | | | | | information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
* Attributes accepting an EnumArgument are allowed to pass a string literal, ↵Aaron Ballman2014-12-191-0/+1
| | | | | | | | or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal. This change affects the only attribute accepting a variadic enumeration: callable_when. llvm-svn: 224582
* Consumed analysis: add two new attributes which fine-tune the behavior ofDeLesley Hutchins2014-01-141-0/+10
| | | | | | | | consumable objects. These are useful for implementing error codes that must be checked. Patch also includes some significant refactoring, which was necesary to implement the new behavior. llvm-svn: 199169
* Updated the wording of two attribute-related diagnostics so that they print ↵Aaron Ballman2014-01-021-3/+3
| | | | | | the offending attribute name. Also updates the associated test cases. llvm-svn: 198355
* Changed tests_typestate to test_typestate for consistency.Chris Wailes2013-10-291-14/+14
| | | | llvm-svn: 193648
* Consumed Analysis: Allow parameters that are passed by non-const referenceDeLesley Hutchins2013-10-171-0/+2
| | | | | | | to be treated as return values, and marked with the "returned_typestate" attribute. Patch by chris.wailes@gmail.com; reviewed by delesley@google.com. llvm-svn: 192932
* Consumed analysis: replace the consumes attribute with a set_typestateDeLesley Hutchins2013-10-111-11/+11
| | | | | | attribute. Patch by chris.wailes@gmail.com; reviewed and edited by delesley. llvm-svn: 192515
* Consumed analysis: switch from tests_consumed/unconsumed to a generalDeLesley Hutchins2013-10-111-6/+6
| | | | | | 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-10/+12
| | | | | | | | 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
* Tablegen now generates a StringSwitch for attributes containing enumeration ↵Aaron Ballman2013-09-111-1/+1
| | | | | | arguments to map strings to the proper enumeration value. This makes error checking more consistent and reduces the amount of hand-written code required. llvm-svn: 190545
* Consumed Analysis: The 'consumable' attribute now takes a identifier ↵David Blaikie2013-09-061-5/+7
| | | | | | | | | | | | | 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: update to comments in test cases.DeLesley Hutchins2013-09-031-2/+5
| | | | | | Patch by chris.wailes@gmail.com. llvm-svn: 189866
* Consumed analysis: add return_typestate attribute.DeLesley Hutchins2013-09-031-11/+22
| | | | | | | | | | 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-10/+16
| | | | | | | | | | | | 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
* Patch by Chris Wailes <chris.wailes@gmail.com>.DeLesley Hutchins2013-08-121-0/+29
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