[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-15 Thread Devin Coughlin via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL289873: [analyzer] Add a new SVal to support pointer-to-member operations. (authored by dcoughlin). Changed prior to commit: https://reviews.llvm.org/D25475?vs=81598&id=81655#toc Repository: rL LLVM

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-15 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov updated this revision to Diff 81598. kromanenkov added a comment. Fix issues pointed by @dcoughlin and rebase patch on master. https://reviews.llvm.org/D25475 Files: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h include/clang/StaticAnalyzer/Core/PathSensiti

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-14 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin accepted this revision. dcoughlin added a comment. This revision is now accepted and ready to land. Looks good to me, other than some super tiny nits! Thanks for iterating on this -- it is awesome that the analyzer will be able to model this now!! Comment at: include

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-14 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov updated this revision to Diff 81352. kromanenkov added a comment. Thanks for your comments, Devin! You were right about the list of path specifiers construction order, so i fix it. Now the base specifier list is being used for figuring out the correct subobject field. Also this diff

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-13 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:899 +case UO_AddrOf: { + // Process pointer-to-member address operation + const Expr *Ex = U->getSubExpr()->IgnoreParens(); kromanenkov wrote: > dcoughlin wrote:

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-12-13 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:899 +case UO_AddrOf: { + // Process pointer-to-member address operation + const Expr *Ex = U->getSubExpr()->IgnoreParens(); dcoughlin wrote: > Just sticking this

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-30 Thread Devin Coughlin via Phabricator via cfe-commits
dcoughlin added a comment. PointerToMemberData looks like it is on the right track! One thing that is still missing is using the base specifier list to figure out the correct subobject field to read and write from. This is important when there is non-virtual multiple inheritance, as there will

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-29 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov marked an inline comment as done. kromanenkov added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:217 + + llvm::ImmutableList consCXXBase( + const CXXBaseSpecifier *CBS, NoQ wrote: > Hmm, is it

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-29 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov updated this revision to Diff 79560. kromanenkov added a comment. Thanks for your comments, Artem! Make function name less ambiguous. Also I take liberty to update analogical function name. https://reviews.llvm.org/D25475 Files: include/clang/StaticAnalyzer/Core/PathSensitive/Bas

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-28 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. This looks good to me (bikeshedded a bit), but i think Devin should have another look, because his comments were way deeper than mine. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h:217 + + llvm::ImmutableList consCXXBase

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-28 Thread Kirill Romanenkov via Phabricator via cfe-commits
kromanenkov added a comment. ping https://reviews.llvm.org/D25475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-18 Thread Kirill Romanenkov via cfe-commits
kromanenkov added a comment. ping https://reviews.llvm.org/D25475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-11-07 Thread Kirill Romanenkov via cfe-commits
kromanenkov updated this revision to Diff 77041. kromanenkov added a comment. According to dcoughlin suggestion PointerToMember SVal is now modeled as a PointerUnion of DeclaratorDecl and bump pointer-allocated object stored DeclaratorDecl and immutable linked list of CXXBaseSpecifiers. https:

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-24 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && kromanenkov wrote: > dcoughli

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-24 Thread Kirill Romanenkov via cfe-commits
kromanenkov added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && dcoughlin wrote: > dcoughli

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && dcoughlin wrote: > dcoughlin

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && dcoughlin wrote: > I don't th

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Devin Coughlin via cfe-commits
dcoughlin added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngineC.cpp:462 + case CK_ReinterpretMemberPointer: { +const Expr *UOExpr = CastE->getSubExpr()->IgnoreParenCasts(); +assert(isa(UOExpr) && I don't think pattern matchin

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Kirill Romanenkov via cfe-commits
kromanenkov updated this revision to Diff 75020. kromanenkov added a comment. Null pointer-to-member dereference is now modeled as UndefinedVal. Fixing this also releases us from loading from nonloc SVal. I delete an assertion suppression in ExprEngine::performTrivialCopy because I can't reprodu

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-18 Thread Artem Dergachev via cfe-commits
NoQ added inline comments. Comment at: test/Analysis/pointer-to-member.cpp:79 // FIXME: Should emit a null dereference. return obj.*member; // no-warning } kromanenkov wrote: > NoQ wrote: > > In fact, maybe dereferencing a null pointer-to-member should pro

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-14 Thread Kirill Romanenkov via cfe-commits
kromanenkov added inline comments. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314 { + // Return to fulfil assert condition + if (location.getAs()) NoQ wrote: > Hmm. Why would anybody try to load anything from a plain pointer-to-member, > rather than

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-12 Thread Artem Dergachev via cfe-commits
NoQ added a comment. Yay, thanks for posting this! :) I've got a bit of concern for some assert-suppressions. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:2314 { + // Return to fulfil assert condition + if (location.getAs()) Hmm. Why would anybody try

[PATCH] D25475: [analyzer] Add a new SVal to support pointer-to-member operations.

2016-10-11 Thread Kirill Romanenkov via cfe-commits
kromanenkov created this revision. kromanenkov added reviewers: zaks.anna, NoQ, dcoughlin. kromanenkov added subscribers: a.sidorin, cfe-commits. Add a new type of NonLoc SVal for pointer-to-member operations. This SVal supports both pointers to member functions and pointers to member data. htt