Commit Graph

8 Commits

Author SHA1 Message Date
George Karpenkov faff2291a9 [analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by default
Differential Revision: https://reviews.llvm.org/D51251

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340963 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 20:29:17 +00:00
George Karpenkov e0586d3d1f [analyzer] [tests] Again, make tests more resilient to changes in exploration strategy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326529 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 01:41:19 +00:00
George Karpenkov acf1c1bc6c [analyzer] [NFC] [tests] Make test more resilient to changes in exploration strategy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326518 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 00:54:05 +00:00
George Karpenkov 54d1490d2d [analyzer] Switch the default exploration strategy to priority queue based on coverage
After the investigation it seems safe to flip the switch.

Differential Revision: https://reviews.llvm.org/D43782

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326157 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 01:31:56 +00:00
Peter Szecsi b25397ba80 [analyzer] MisusedMovedObjectChecker: More precise warning message
Added new enum in order to differentiate the warning messages on "misusing" into
3 categories: function calls, moving an object, copying an object. (At the
moment the checker gives the same message in case of copying and moving.)

Additional test cases added as well.

Differential Revision: https://reviews.llvm.org/D38674



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-28 23:24:00 +00:00
Peter Szecsi a3962bae3f [analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling method calls on base-class sub-objects
An earlier solution from Artem r315301 solves the reset problem, however, the
reports should be handled the same way in case of method calls. We should not
just report the base class of the object where the method was defined but the
whole object.

Fixed false positive which came from not removing the subobjects in case of a
state-resetting function. (Just replaced the State->remove(...) call to
removeFromState(..) which was defined exactly for that purpose.)

Some minor typos fixed in this patch as well which did not worth a whole new
patch in my opinion, so included them here.

Differential Revision: https://reviews.llvm.org/D31538



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-28 23:09:37 +00:00
Artem Dergachev 18e9d0430b [analyzer] MisusedMovedObject: Fix state-resetting a base-class sub-object.
If a method is resetting the state of an object that was moved from, it should
be safe to use this object again. However if the method was defined in a parent
class, but used in a child class, the reset didn't happen from the checker's
perspective.

Differential Revision: https://reviews.llvm.org/D31538


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 11:55:56 +00:00
Artem Dergachev 03276d3175 [analyzer] Add MisusedMovedObjectChecker for detecting use-after-move errors.
The checker currently warns on copying, moving, or calling methods on an object
that was recently std::move'd from. It understands a set of "state reset"
methods that bring a moved-from object back to a well-specified state.

Patch by Peter Szecsi!

Differential Revision: https://reviews.llvm.org/D24246


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298698 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 09:52:30 +00:00