History log of /external/clang/lib/Analysis/Consumed.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4967a710c84587c654b56c828382219c3937dacb 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang for rebase to r275480

Bug: http://b/31320715

This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
/external/clang/lib/Analysis/Consumed.cpp
87d948ecccffea9e9e37d0d053b246e2d6d6c47b 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

Change-Id: I5d349c9843ea5c24d6e455956f8a446393b6873d
/external/clang/lib/Analysis/Consumed.cpp
58878f85ab89b13e9eea4af3ccf055e42c557bc8 06-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r235153

Change-Id: Ia94bbcb6da7c75b6e7c2afedd1001094d62a7324
/external/clang/lib/Analysis/Consumed.cpp
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/lib/Analysis/Consumed.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Analysis/Consumed.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Analysis/Consumed.cpp
4c3e0bc7850df76824138ecfcc434388e7f69559 16-Nov-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: track state of temporary objects.
Earlier versions discarded the state too soon, and did not track state changes,
e.g. when passing a temporary to a move constructor. Patch by
chris.wailes@gmail.com; review and minor fixes by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
1aa89697dc73760dce700e99d78c5805aa8bd7bb 31-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Fixed bug with checking the kind of types.

The isLValueReferenceType function checks to see if the QualType's
canonical type is an LValue reference, and not if the QualType
itself is an LValue reference. This caused a segfault when trying
to cast the QualType's Type to a LValueReference. This is now
fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent
segfaults when a type being tested by the analysis is a reference
to a pointer or a pointer to a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
0e429f1f48298b749cd0b0d6e931ed15c2a7a2b1 29-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Changed tests_typestate to test_typestate for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
a0cbcabb1beaee6c0cd5d4aa30cd9450ff5331ea 25-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Used OwningPtr to clean up some memory management in Consumed.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
de2204b56096e2336d19b1feae8b1be99dfb49fa 24-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Replaced duplicate code with calls to forwardInfo.

Also made move constructor handling safer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
13be03222faa22b1a1088ea5c1a00014934b9ee4 19-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: fix assert failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
be63ab6612b250972ae528ae910e5fa64f9c5731 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: assume that non-const reference parameters are initially
in the "uknown" state. Patch by chris.wailes@gmail.com. Reviewed by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
c5cdafcdb8eea9625e86b015ba7a2504f18a99b7 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: All the return_typestate parameter to be attached to the
default constructor. Patch by chris.wailes@gmail.com, reviewed by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
d4f0e1991f42c69111213699fb2d09dedee1cd36 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: Add param_typestate attribute, which specifies that
function parameters must be in a particular state. Patch by
chris.wailes@gmail.com. Reviewed by delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
cd0f6d7600a691ad81dab308e9905fb0cce1df4d 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed Analysis: Allow parameters that are passed by non-const reference
to be treated as return values, and marked with the "returned_typestate"
attribute. Patch by chris.wailes@gmail.com; reviewed by delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
52f717eba7eff69c97d64de5e3669f4a5ee57d5c 17-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: fix ICE in handling of loop source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
f30e194f9d797ebeb2f6c3f96e88160ed1a6519a 12-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: replace the consumes attribute with a set_typestate
attribute. Patch by chris.wailes@gmail.com; reviewed and edited by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
1bf6343612e394051fffc587e6899de6901065e0 12-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: switch from tests_consumed/unconsumed to a general
tests_typestate attribute. Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
627c7f9740dfe9c208543798eccbe5ca23e1ef42 11-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: check destructor calls.
This allows the callable_when attribute to be attached to destructors.
Original patch by chris.wailes@gmail.com, reviewed and edited by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192508 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
7385840b600d0e4a96d75042f612f6430e4a0390 09-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: improve loop handling. The prior version of the analysis
marked all variables as "unknown" at the start of a loop. The new version
keeps the initial state of variables unchanged, but issues a warning if the
state at the end of the loop is different from the state at the beginning.
This patch will eventually be replaced with a more precise analysis.

Initial patch by chris.wailes@gmail.com. Reviewed and edited by
delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
66540857c08de7f1be9bea48381548d3942cf9d1 04-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed Analysis: Change callable_when so that it can take a list of states
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
57b781dde2676cd1bd838a1cdd56d3aeea091d11 11-Sep-2013 DeLesley Hutchins <delesley@google.com> Fix ICE in consumed analysis when CFG is null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
a33ab6074a2cc60fe895d6669f9ee776c5fea335 06-Sep-2013 David Blaikie <dblaikie@gmail.com> Consumed Analysis: The 'consumable' attribute now takes a identifier 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
e988dc45254405aff0950337d82aa8623fb1b88e 03-Sep-2013 Eric Christopher <echristo@gmail.com> Fix non-void return warning, and format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
0e8534efc3c536795ede0128aed86a6b8ad53ab7 03-Sep-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: add return_typestate attribute.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
c55bee6e278d888d7a5d29fc17df6a9ae1e8b7d3 31-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: add 'consumable' class attribute.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
4252598a2e58c3f74027511f535ed327f9b32b77 30-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: track function parameters.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
d324a0bcda2754c6fe0b5e27ad50e42850d498c4 29-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: non-const methods no longer transfer an object into an
unknown state. Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
6b2ec037f16753547398efe1812160982f1d14e4 29-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Silencing the warning from r189605 in a more conformant manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
1f55157a5b3f60389e32b337bdf50eeea50f8f77 29-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Silencing a rather spurious warning from MSVC 11 about not all control paths returning a value (hint: they do).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
e444ea0f5c8c8cf677edd05d9fb1254422765bd5 29-Aug-2013 Eric Christopher <echristo@gmail.com> Fix warning about anonymous structs in anonymous unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
b7dc1f5f30e1e46e44389b036d48f9614cfd5fe3 29-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: improve handling of conditionals.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
b01e2da54178f1b1b6ef43bf3fa91dcdd3ff3094 26-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analyis: Renamed *PStatus to *PInfo.
The change was made for readability, as the PropagationInfo objects don't
always contain a status. This is submitted as a separate patch because it
touches a lot of lines and I don't want it cluttering up the next patch.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
5fdd207ec8f4c1f58bd74f8a84ce1935487563ce 22-Aug-2013 DeLesley Hutchins <delesley@google.com> Update to consumed analysis.

Patch by chris.wailes@gmail.com. The following functionality was added:

* The same functionality is now supported for both CXXOperatorCallExprs and CXXMemberCallExprs.
* Factored out some code in StmtVisitor.
* Removed variables from the state map when their destructors are encountered.
* Started adding documentation for the consumed analysis attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
a72f7206a71b3901d1b4b2b4718a5013f46010f2 13-Aug-2013 Reid Kleckner <reid@kleckner.net> Silence a warning from MSVC about not returning a value

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
2d84f6b563e39c1e90e4d3d7e6846d46bc58ff5d 13-Aug-2013 Reid Kleckner <reid@kleckner.net> Remove Sema includes from Analysis code to fix layering

This moves a header-only class from Sema to Analysis and puts the option
check in Sema.

Patch by Chris Wailes!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188230 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
2d66dfa35375e032cd58a2580da8dd41ec955fc9 13-Aug-2013 Hans Wennborg <hans@hanshq.net> Speculative build fix for r188206.

The cmake-clang-x86_64 was upset:
error: 'template<class ImplClass, class RetTy> class clang::ConstStmtVisitor' used without template parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp
df7bef07eebd5c7913e8be09c62a6a470f255fd2 12-Aug-2013 DeLesley Hutchins <delesley@google.com> Patch by Chris Wailes <chris.wailes@gmail.com>.
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Analysis/Consumed.cpp