#
d6145d98 |
| 14-Sep-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields
Based on a suggestion from @george.karpenkov.
In some cases, structs are used as unions with a help of a tag/k
[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields
Based on a suggestion from @george.karpenkov.
In some cases, structs are used as unions with a help of a tag/kind field. This patch adds a new string flag (a pattern), that is matched against the fields of a record, and should a match be found, the entire record is ignored.
For more info refer to http://lists.llvm.org/pipermail/cfe-dev/2018-August/058906.html and to the responses to that, especially http://lists.llvm.org/pipermail/cfe-dev/2018-August/059215.html.
Differential Revision: https://reviews.llvm.org/D51680
llvm-svn: 342220
show more ...
|
#
6cec6c46 |
| 14-Sep-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Refactored checker options
Since I plan to add a number of new flags, it made sense to encapsulate them in a new struct, in order not to pollute FindUninitiali
[analyzer][UninitializedObjectChecker] Refactored checker options
Since I plan to add a number of new flags, it made sense to encapsulate them in a new struct, in order not to pollute FindUninitializedFields's constructor with new boolean options with super long names.
This revision practically reverts D50508, since FindUninitializedFields now accesses the pedantic flag anyways.
Differential Revision: https://reviews.llvm.org/D51679
llvm-svn: 342219
show more ...
|
#
ceb5f654 |
| 14-Sep-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Updated comments
Some of the comments are incorrect, imprecise, or simply nonexistent. Since I have a better grasp on how the analyzer works, it makes sense to
[analyzer][UninitializedObjectChecker] Updated comments
Some of the comments are incorrect, imprecise, or simply nonexistent. Since I have a better grasp on how the analyzer works, it makes sense to update most of them in a single swoop.
I tried not to flood the code with comments too much, this amount feels just right to me.
Differential Revision: https://reviews.llvm.org/D51417
llvm-svn: 342215
show more ...
|
#
f0dd1016 |
| 14-Sep-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Fixed dereferencing
iThis patch aims to fix derefencing, which has been debated for months now.
Instead of working with SVals, the function now relies on Type
[analyzer][UninitializedObjectChecker] Fixed dereferencing
iThis patch aims to fix derefencing, which has been debated for months now.
Instead of working with SVals, the function now relies on TypedValueRegion.
Differential Revision: https://reviews.llvm.org/D51057
llvm-svn: 342213
show more ...
|
Revision tags: llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2 |
|
#
06209cb4 |
| 21-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer] Correctly marked a virtual function 'override'
llvm-svn: 340280
|
#
b59b45e7 |
| 21-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Explicit namespace resolution for inherited data members
For the following example:
struct Base { int x; };
// In a different translation unit
s
[analyzer][UninitializedObjectChecker] Explicit namespace resolution for inherited data members
For the following example:
struct Base { int x; };
// In a different translation unit
struct Derived : public Base { Derived() {} };
For a call to Derived::Derived(), we'll receive a note that this->x is uninitialized. Since x is not a direct field of Derived, it could be a little confusing. This patch aims to fix this, as well as the case when the derived object has a field that has the name as an inherited uninitialized data member:
struct Base { int x; // note: uninitialized field 'this->Base::x' };
struct Derived : public Base { int x = 5; Derived() {} };
Differential Revision: https://reviews.llvm.org/D50905
llvm-svn: 340272
show more ...
|
#
2e406722 |
| 21-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Added documentation to the checker list
Differential Revision: https://reviews.llvm.org/D50904
llvm-svn: 340266
|
#
64601965 |
| 21-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[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 mo
[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
llvm-svn: 340265
show more ...
|
#
e3b1d962 |
| 13-Aug-2018 |
George Karpenkov <ekarpenkov@apple.com> |
[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields
Differential Revision: https://reviews.llvm.org/D50673
llvm-svn: 339631
|
#
651d683e |
| 13-Aug-2018 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix Clang warnings and bad #include filenames in r339595 and r339599.
llvm-svn: 339624
|
#
23ca9660 |
| 13-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode in the checker class only
Differential Revision: https://reviews.llvm.org/D50508
llvm-svn: 339601
|
#
015b0595 |
| 13-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[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,
[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
llvm-svn: 339599
show more ...
|
#
a37bba47 |
| 13-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from FieldChainInfo
This is a standalone part of the effort to reduce FieldChainInfos inteerface.
Differential Revision:
[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
llvm-svn: 339596
show more ...
|
#
56963aec |
| 13-Aug-2018 |
Kristof Umann <dkszelethus@gmail.com> |
[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:
FieldChain
[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
llvm-svn: 339595
show more ...
|