Commit Graph

8 Commits

Author SHA1 Message Date
Kristof Umann 1bdc37d05e [analyzer][UninitializedObjectChecker] Added documentation to the checker list
Differential Revision: https://reviews.llvm.org/D50904


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340266 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 10:47:19 +00:00
Kristof Umann 01b8a31de3 [analyzer][UninitializedObjectChecker] Refactoring p6.: Move dereferencing to a function
Now that it has it's own file, it makes little sense for
isPointerOrReferenceUninit to be this large, so I moved
dereferencing to a separate function.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340265 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-21 10:45:21 +00:00
George Karpenkov 39e21032cb [analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields
Differential Revision: https://reviews.llvm.org/D50673

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339631 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 23:32:15 +00:00
Richard Smith 09d5c6b600 Fix Clang warnings and bad #include filenames in r339595 and r339599.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 22:07:11 +00:00
Kristof Umann 9b127f0e72 [analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode in the checker class only
Differential Revision: https://reviews.llvm.org/D50508


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339601 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:48:34 +00:00
Kristof Umann 532d704249 [analyzer][UninitializedObjectChecker] Refactoring p4.: Wrap FieldRegions and reduce weight on FieldChainInfo
Before this patch, FieldChainInfo used a spaghetti: it took care of way too many cases,
even though it was always meant as a lightweight wrapper around
ImmutableList<const FieldRegion *>.
This problem is solved by introducing a lightweight polymorphic wrapper around const
FieldRegion *, FieldNode. It is an interface that abstracts away special cases like
pointers/references, objects that need to be casted to another type for a proper note
messages.

Changes to FieldChainInfo:

  * Now wraps ImmutableList<const FieldNode &>.
  * Any pointer/reference related fields and methods were removed
  * Got a new add method. This replaces it's former constructors as a way to create a
    new FieldChainInfo objects with a new element.

Changes to FindUninitializedField:

  * In order not to deal with dynamic memory management, when an uninitialized field is
    found, the note message for it is constructed and is stored instead of a
    FieldChainInfo object. (see doc around addFieldToUninits).

Some of the test files are changed too, from now on uninitialized pointees of references
always print "uninitialized pointee" instead of "uninitialized field" (which should've
really been like this from the beginning).

I also updated every comment according to these changes.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:43:08 +00:00
Kristof Umann 2ed34ac167 [analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from FieldChainInfo
This is a standalone part of the effort to reduce FieldChainInfos inteerface.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339596 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:22:22 +00:00
Kristof Umann 4f97dae072 [analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer chasing to a separate file
In this patch, the following classes and functions have been moved to a header file:

    FieldChainInfo
    FindUninitializedFields
    isPrimitiveType

This also meant that they moved from anonymous namespace to clang::ento.

Code related to pointer chasing now relies in its own file.

There's absolutely no functional change in this patch -- its literally just copy pasting.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339595 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-13 18:17:05 +00:00