[PATCH] [patch] Adding Consumed Analysis to Clang

Chris Wailes chris.wailes at gmail.com
Mon Aug 12 13:44:54 PDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130812/2aef56b1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: consumed_initial.patch
Type: application/octet-stream
Size: 58057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130812/2aef56b1/attachment.obj>


More information about the cfe-commits mailing list