[PATCH] [patch] Adding Consumed Analysis to Clang

Delesley Hutchins delesley at google.com
Mon Aug 12 14:23:29 PDT 2013


LGTM.
Commited as r188206.


On Mon, Aug 12, 2013 at 1:44 PM, Chris Wailes <chris.wailes at gmail.com> wrote:
> Attached is the final draft of the patch to add consumed analysis to the
> Clang compiler.
>
> Commit message:
>
> 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 ot our analysis.  The code
> is still highly experimental, and the names of annotations or the algorithm
> may be subject to change.
>
> - Chris



-- 
DeLesley Hutchins | Software Engineer | delesley at google.com | 505-206-0315



More information about the cfe-commits mailing list