[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-17 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1759 +if (isa(ElseCond)) { + assert(cast(ElseCond)->isLogicalOp()); + return isAssertlikeBlock(Else, Context);

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-14 Thread Kristóf Umann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368836: [analyzer][CFG] Don't track the condition of asserts (authored by Szelethus, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-13 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. Wish granted! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https://reviews.llvm.org/D65287 ___ cfe-commits mailing list cfe-commit

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-13 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added a comment. If you have no major objections, could you please accept formally? :) And I'll promise to draw CFG graphs all day tomorrow as an exercise after reading the order of operator evaluation rules >.< CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https:

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-13 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1750 + // [B1] -> [B2] -> [B3] -> [sink] + // assert(A && B || C);\ \ \ + // ---> [go on with the executi

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:5634 + // immediately caught. + if (std::any_of(Blk->begin(), Blk->end(), [](const CFGElement &Elm) { +if (Optional StmtElm = Elm.getAs()) xazax.hun wrote: > I am wondering, should

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-12 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 214708. Szelethus marked 12 inline comments as done. Szelethus added a comment. Addressing reviewer feedback! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https://reviews.llvm.org/D65287 Files: clang/include/clang/Analysis/CFG.h c

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-09 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1750 + // [B1] -> [B2] -> [B3] -> [sink] + // assert(A && B || C);\ \ \ + // ---> [go on with the executi

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-08 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/Analysis/CFG.h:859 + /// Returns true if the block would eventually end with a sink (a noreturn + /// node). We scan the child CFG blocks in a depth-first manner and see if + /// all paths eventually end up in an

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-08 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/test/Analysis/track-control-dependency-conditions.cpp:469-471 +extern void __assert_fail (__const char *__assertion, __const char *__file, + unsigned int __lin

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-08 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added a comment. After testing this patch out, I'm confident it works pretty well. Take a look at the following two runs: 138 notes

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-07 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1753-1755 + // It so happens that CFGBlock::getTerminatorCondition returns 'A' for block + // B1, 'A && B' for B2, and 'A && B || C' for B3. Let's check whether we + // reached the end

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus marked an inline comment as done. Szelethus added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1753-1755 + // It so happens that CFGBlock::getTerminatorCondition returns 'A' for block + // B1, 'A && B' for B2, and 'A && B || C' fo

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-08-01 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus updated this revision to Diff 212803. Szelethus marked 10 inline comments as done. Szelethus added a comment. Fixes according to reviewer comments! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65287/new/ https://reviews.llvm.org/D65287 Files: clang/include/clang/Analysis/C

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1743 + + if (Then->isInevitablySinking() || Else->isInevitablySinking()) +return true; xazax.hun wrote: > Do we consider a block assert like if both b

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-29 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/Analysis/CFG.h:860 + /// child CFG blocks in a depth-first manner and see if all paths eventually + /// end up in an immediate sink block. + bool isInevitablySinking() const; Is it obvious what s

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-25 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I'm sure i've seen something with a do-while(0) loop. Let's also add the following: #define assert(x) do {\ if (!x) \ __assert_fail (#expr, __FILE__, __LINE__, __func__) \ } w

[PATCH] D65287: [analyzer][CFG] Don't track the condition of asserts

2019-07-25 Thread Kristóf Umann via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, a_sidorin, rnkovacs, dcoughlin. Szelethus added a project: clang. Herald added subscribers: cfe-commits, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Well,