[PATCH] D51680: [analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 10 10:31:12 PDT 2018


Szelethus marked an inline comment as done.
Szelethus added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:468
+static bool isUnionLike(const RecordDecl *RD) {
+  llvm::Regex ContainsKindOrTag("[kK]ind|[tT]ag");
+
----------------
george.karpenkov wrote:
> 1. Since you are using `match`, you would reject an extra prefix - but what about an extra suffix?
> 2. Would it make sense to expose the entire regexp as a flag? Then you could remove the boolean flag (if you can change the regexp to match if only the entire field name matches, then an empty regexp would correspond to "no matches")
1. Added a new test case, seems to be fine ^-^
2. Sounds cool, so I made it happen.


https://reviews.llvm.org/D51680





More information about the cfe-commits mailing list