[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields
authorKristof Umann <dkszelethus@gmail.com>
Fri, 14 Sep 2018 10:10:09 +0000 (10:10 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Fri, 14 Sep 2018 10:10:09 +0000 (10:10 +0000)
commitd6145d9849f48229980c9243c36cb08c2e45c869
treee6b9431b2dc1e4eb85f23eb2570ac5c944b3bde3
parent6cec6c467ce93fafcf002a781326bfeaa57c6f49
[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
clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h
clang/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp
clang/test/Analysis/cxx-uninitialized-object-unionlike-constructs.cpp [new file with mode: 0644]
clang/www/analyzer/alpha_checks.html