[PATCH] D53206: Allow padding checker to traverse simple class hierarchies
Max Bernstein via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 26 11:47:50 PDT 2018
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 wrote:
> NoQ wrote:
> > This check is already in `shouldSkipDecl()` (?)
> Oh yes, you're right.
Actually, I'm not sure if you're right. I think it's necessary here because it's only tested for C++ classes in shouldSkipDecl(). This tests it for C structs too. Either we could lift that outside the C++ section of shouldSkipDecl or repeat it here.
Repository:
rC Clang
https://reviews.llvm.org/D53206
More information about the cfe-commits
mailing list