[PATCH] D47350: [analyzer] Track class member initializer constructors path-sensitively within their construction context.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 30 16:23:15 PDT 2018


NoQ added a comment.

Refactor everything to address review comments.



================
Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:123
+/// AST nodes.
+class ConstructedObjectKey : public ConstructedObjectKeyImpl {
+  const void *getAnyASTNodePtr() const {
----------------
george.karpenkov wrote:
> sorry I find that very confusing, and I think the previous version was better (prefer composition over inheritance)
Ok, so, i mean, i don't think it would be faster, i really hope the compiler would know how to inline `std::pair` methods. I think converting to a `std::pair` or `std::tuple` is a fairly standard trick to avoid `x < rhs.x || (x == rhs.x && y < rhs.y)` kind of code. But with inheritance we at least have boilerplate operators sorted out for free.

May i leave the actual previous version around without fixing it?^^


https://reviews.llvm.org/D47350





More information about the cfe-commits mailing list