[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-29 Thread Alexander Shaposhnikov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345558: [analyzer] Allow padding checker to traverse simple class hierarchies (authored by alexshap, committed by ). Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Ch

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-29 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi updated this revision to Diff 171568. tekknolagi added a comment. Skip non-definitions in `VisitRecord` Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp test/Analysis/padding_inherit.cpp Index: test/Analysis/padding_in

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-26 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:78-81 +// We need to be looking at a definition, not just any pointer to the +// declaration. +if (!(RD = RD->getDefinition())) + return; tekknolagi wrote: > te

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-26 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:78-81 +// We need to be looking at a definition, not just any pointer to the +// declaration. +if (!(RD = RD->getDefinition())) + return; tekknolagi wrot

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-25 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added a comment. @NoQ I think @alexshap will be committing this. Thanks Repository: rC Clang https://reviews.llvm.org/D53206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. Thanks! Also do you have commit access or do you need someone to commit this for you? Repository: rC Clang https://reviews.llvm.org/D53206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-25 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi updated this revision to Diff 171234. tekknolagi added a comment. Add comments suggested by @NoQ and @bcraig Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp test/Analysis/padding_inherit.cpp Index: test/Analysis/paddi

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-25 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:78-81 +// We need to be looking at a definition, not just any pointer to the +// declaration. +if (!(RD = RD->getDefinition())) + return; NoQ wrote: > Th

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. Patch looks great, thanks! Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:78-81 +// We need to be looking at a definition, not just any pointer to the +// decla

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-24 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. I'll try to take a look this week. Repository: rC Clang https://reviews.llvm.org/D53206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-24 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added a comment. Ping @NoQ @george.karpenkov Repository: rC Clang https://reviews.llvm.org/D53206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-24 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. add a comment, and it will be fine in my eyes. You'll need signoff from the code owner though. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-22 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi updated this revision to Diff 170475. tekknolagi added a comment. Make the test case a little easier to read Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp test/Analysis/padding_inherit.cpp Index: test/Analysis/paddi

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-22 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added inline comments. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char c1; + int i; + char c2; +}; + tekknolagi wrote: > bcraig wrote: > > Lo

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-22 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi updated this revision to Diff 170464. tekknolagi edited the summary of this revision. tekknolagi added a comment. Remove useless test case in `padding_cpp.cpp` Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp test/Analy

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-22 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added inline comments. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char c1; + int i; + char c2; +}; + bcraig wrote: > Looking at this again...

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-22 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. @bcraig comments look valid, marking as "Needs Changes" Repository: rC Clang https://reviews.llvm.org/D53206 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Ben Craig via Phabricator via cfe-commits
bcraig added inline comments. Comment at: test/Analysis/padding_cpp.cpp:204-212 +// expected-warning@+1{{Excessive padding in 'struct FakeIntSandwich'}} +struct FakeIntSandwich { + char c1; + int i; + char c2; +}; + Looking at this again... what new cases does

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi updated this revision to Diff 169501. tekknolagi added a comment. Fix confusing & wrong if-statements, add new test suggested by @bcraig Repository: rC Clang https://reviews.llvm.org/D53206 Files: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp test/Analysis/padding_cpp.cpp t

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a reviewer: george.karpenkov. NoQ added a comment. I'll take care of this review as an [analyzer]-responsible person, maybe not immediately because i'm a bit overwhelmed right now - sorry! - and George may want to have a look (also or instead). Repository: rC Clang https://reviews

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi added inline comments. Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:167-171 } +// How do you reorder fields if you haven't got any? +else if (RD->field_empty()) + return true; + bcraig wrote: > I think this should just b

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi edited reviewers, added: dcoughlin; removed: malcolm.parsons. tekknolagi added a comment. Sorry @malcolm.parsons -- I misunderstood code owners. Should not have just looked at a blame of the file... Repository: rC Clang https://reviews.llvm.org/D53206 __

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Ben Craig via Phabricator via cfe-commits
bcraig added a comment. You should probably add whoever the current code owner of that static analyzer to this review. I have very little involvement with Clang these days, so a "LGTM" from me doesn't carry much weight. Comment at: lib/StaticAnalyzer/Checkers/PaddingChecker.

[PATCH] D53206: Allow padding checker to traverse simple class hierarchies

2018-10-12 Thread Max Bernstein via Phabricator via cfe-commits
tekknolagi created this revision. tekknolagi added reviewers: bcraig, NoQ. tekknolagi added a project: clang. The existing padding checker skips classes that have any base classes. This patch allows the checker to traverse very simple cases: classes that have no fields and have one base class.