[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-05-07 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331630: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType… (authored by szepet, committed by ). Changed prior to commit: https://reviews.llvm.org/D38845?vs=145159&id=145447#toc Re

[PATCH] D40937: [clang-tidy] Infinite loop checker

2018-05-04 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 145160. szepet marked 2 inline comments as done. szepet added a comment. Changes based on comments. https://reviews.llvm.org/D40937 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/InfiniteLoopChe

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-05-04 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 145159. szepet added a comment. Format changes added based on comments. https://reviews.llvm.org/D38845 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp ===

[PATCH] D46019: [ASTImporter] Fix isa cast assert

2018-05-02 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331344: [ASTImporter] Fix isa cast assert (authored by szepet, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D46019 Files: cfe/trunk/lib/AST/A

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-05-02 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 144842. szepet marked an inline comment as done. szepet added a comment. Yepp, good point, Aleksei, rewritten the tests using explicit instantiation. https://reviews.llvm.org/D38845 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index:

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-04-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet marked an inline comment as done. szepet added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:1569 +FirstDeclMatcher().match(*TB, Pattern); +if (!FromDSDRE) + return; martong wrote: > I think, this `if` would be needed only

[PATCH] D46019: [ASTImporter] Fix isa cast assert

2018-04-25 Thread Peter Szecsi via Phabricator via cfe-commits
szepet accepted this revision. szepet added a comment. Yepp, pretty straightforward check for something we were not aware previously (but unfortunately encountered it). Repository: rC Clang https://reviews.llvm.org/D46019 ___ cfe-commits mailing

[PATCH] D40937: [clang-tidy] Infinite loop checker

2018-04-25 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 143949. szepet marked 2 inline comments as done. szepet added a comment. Changes made based on comments. The CFG recreating problem is handled the following (only for this check): Always store the last visited function and its CFG* (in form of the Sequence*) a

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-04-25 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 143925. szepet added a comment. Rewritten the tests using the newly added TEST_P method. This patch failed earlier when -fdelayed-template-parsing flag was enabled, however, the actual import process was OK but the original AST havent included the checked nod

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2018-04-11 Thread Peter Szecsi via Phabricator via cfe-commits
szepet marked an inline comment as done. szepet added a comment. Hello Aleksei, Thanks for carrying the ASTImporter improvements (in general)! I will rebase it and upload for sure, but probably just next week. (After EuroLLVM.) https://reviews.llvm.org/D38845 ___

[PATCH] D40937: [clang-tidy] Infinite loop checker

2018-04-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 141322. szepet marked 4 inline comments as done. szepet added a comment. Addressed comments and readded the lost fixes. https://reviews.llvm.org/D40937 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugp

[PATCH] D40937: [clang-tidy] Infinite loop checker

2018-04-05 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: clang-tidy/misc/InfiniteLoopCheck.cpp:121 + + Stmt *FunctionBody = nullptr; + if (ContainingLambda) xazax.hun wrote: > This could be pointer to const, right? Since the createSequence uses it as a parameter for buildCFG

[PATCH] D40937: [clang-tidy] Infinite loop checker

2018-04-05 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 141132. szepet marked 3 inline comments as done. szepet added a comment. Removed to bugprone category, skipping memberExpr cases for now in order to avoid false positives, other small changes based on review comments. https://reviews.llvm.org/D40937 Files:

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-30 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC328906: [ASTImporter] Add test helper Fixture (authored by szepet, committed by ). Changed prior to commit: https://reviews.llvm.org/D43967?vs=139791&id=140497#toc Repository: rC Clang https://revie

[PATCH] D45086: [analyzer] Unroll the loop when it has a unsigned counter.

2018-03-30 Thread Peter Szecsi via Phabricator via cfe-commits
szepet accepted this revision. szepet added a comment. Yepp, thanks for the patch! One small typo below. Comment at: test/Analysis/loop-unrolling.cpp:50 + +int simple_unroll4_unsinged() { + int a[9]; typo: unsigned Repository: rC Clang https://reviews.llv

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2018-03-27 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC328619: [analyzer] LoopUnrolling: update the matched assignment operators (authored by szepet, committed by ). Repository: rC Clang https://reviews.llvm.org/D38921 Files: lib/StaticAnalyzer/Core/Loo

[PATCH] D44893: [ASTMatchers] Add isAssignmentOperator matcher

2018-03-27 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC328618: [ASTMatchers] Add isAssignmentOperator matcher (authored by szepet, committed by ). Changed prior to commit: https://reviews.llvm.org/D44893?vs=139769&id=139900#toc Repository: rC Clang http

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2018-03-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 139776. szepet added a comment. Added the assignment operator matcher patch as a dependency and rebased on top of that. https://reviews.llvm.org/D38921 Files: lib/StaticAnalyzer/Core/LoopUnrolling.cpp test/Analysis/loop-unrolling.cpp Index: test/Analys

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2018-03-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet marked 2 inline comments as done. szepet added a comment. In https://reviews.llvm.org/D38921#1037180, @alexfh wrote: > Do you want to submit the matcher part separately? Yepp, but added as a different patch since implemented it for cxxOperatorCall as well. (I guess Aaron's test request

[PATCH] D44893: [ASTMatchers] Add isAssignmentOperator matcher

2018-03-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. szepet added reviewers: aaron.ballman, alexfh. Herald added subscribers: dkrupp, rnkovacs, klimek. Adding a matcher for BinaryOperator and cxxOperatorCallExpr to be able to decide whether it is any kind of assignment operator or not. This would be useful since allow

[PATCH] D44606: [analyzer] Fix the crash in `IteratorChecker.cpp` when `SymbolConjured` has a null Stmt.

2018-03-19 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Nice catch, it looks good to me! Thank you! One small nit for future debugging people: Could you insert a comment line in the test case where you explain what is this all about? E.g what you just have written in the description: "invalidateRegions() will construct the Sy

[PATCH] D42266: [analyzer] Prevent AnalyzerStatsChecker from crash

2018-02-21 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325693: [analyzer] Prevent AnalyzerStatsChecker from crash (authored by szepet, committed by ). Changed prior to commit: https://reviews.llvm.org/D42266?vs=130501&id=135266#toc Repository: rC Clang

[PATCH] D16403: Add scope information to CFG

2018-02-21 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. In https://reviews.llvm.org/D16403#1011218, @NoQ wrote: > Yeah, i mean, like, if we change the scope markers to also appear even when > no variables are present in the scope, then it would be possible to replace > loop markers with some of the scope markers, right? OK,

[PATCH] D39398: [CFG][Analyzer] Add LoopExit element to the CFG in more cases

2018-02-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Herald added a reviewer: george.karpenkov. ping https://reviews.llvm.org/D39398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41150: [CFG] Adding new CFGStmt LoopEntrance for the StaticAnalyzer

2018-02-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Herald added a reviewer: george.karpenkov. ping https://reviews.llvm.org/D41150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D16403: Add scope information to CFG

2018-02-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. In https://reviews.llvm.org/D16403#992452, @NoQ wrote: > Thank you, this explanation looks very reasonable. > > All right, so right after the termination of the loop we have > > [B1] > 1: ForStmt (LoopExit) > 2: [B4.5].~A() (Implicit destructor) > 3: [B5.3].~A() (I

[PATCH] D42266: [analyzer] Prevent AnalyzerStatsChecker from crash

2018-01-21 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. > Would it make sense to use the last element of the block edge's source for > the diagnostic location when the destination block is empty? I do not think so. In the testfile `emptyConditionLoop` function is a great counter example since the last element of the source bl

[PATCH] D41151: [analyzer] Adding LoopContext and improve loop modeling

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: lib/StaticAnalyzer/Core/LoopUnrolling.cpp:28-46 struct LoopState { private: enum Kind { Normal, Unrolled } K; - const Stmt *LoopStmt; - const LocationContext *LCtx; - unsigned maxStep; - LoopState(Kind InK, const Stmt *S, const L

[PATCH] D41151: [analyzer] Adding LoopContext and improve loop modeling

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 130516. szepet marked 2 inline comments as done. szepet added a comment. First, sorry for this delayed update, however, I was working on this and running this on real projects. I wanted to make sure that this update will be complete enough that this patch wou

[PATCH] D41150: [CFG] Adding new CFGStmt LoopEntrance for the StaticAnalyzer

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 130505. szepet added a comment. > I essentially have one question at a glance - for loop counter variables, > don't we want LoopEntrance be before the initialization? I guess this would just make too much sense. Done that. Additionally, handle the cases when

[PATCH] D39398: [CFG][Analyzer] Add LoopExit element to the CFG in more cases

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: test/Analysis/loopexit-cfg-output.cpp:912-914 +// CHECK: [B5] +// CHECK-NEXT: Succs (1): B8 + NoQ wrote: > P.S. This is not a regression introduced by your patch, but i'm really > curious what does this block eve

[PATCH] D39398: [CFG][Analyzer] Add LoopExit element to the CFG in more cases

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 130503. szepet marked 2 inline comments as done. szepet added a comment. Added comments and removed indirect goto support from this patch. > This seems a bit scary because if there's no obvious one-to-once > correspondence between entrances and exits along

[PATCH] D42266: [analyzer] Prevent AnalyzerStatsChecker from crash

2018-01-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. szepet added reviewers: NoQ, dcoughlin, xazax.hun. Herald added subscribers: dkrupp, a.sidorin, rnkovacs, baloghadamsoftware, whisperity. The checker marks the locations where the analyzer creates sinks. However, it can happen that the sink was created because of a

[PATCH] D41150: [CFG] Adding new CFGStmt LoopEntrance for the StaticAnalyzer

2017-12-21 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 127894. szepet marked an inline comment as done. szepet added a comment. Comment added to LoopEntrance CFGElement. https://reviews.llvm.org/D41150 Files: include/clang/Analysis/CFG.h lib/Analysis/CFG.cpp lib/StaticAnalyzer/Core/PathDiagnostic.cpp tes

[PATCH] D41444: [ASTImporterTest] Make testing under '-fdelayed-template-parsing' mandatory

2017-12-21 Thread Peter Szecsi via Phabricator via cfe-commits
szepet accepted this revision. szepet added a comment. In https://reviews.llvm.org/D41444#961110, @a.sidorin wrote: > Test both with and without '-fdelayed-template-parsing' in C++ mode. This solution LGTM as well. Just a small nit added inline. Comment at: unittests/AST/AS

[PATCH] D41077: [analyser] different.CallArgsOrder checker implementation

2017-12-18 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added subscribers: alexfh, szepet. szepet requested changes to this revision. szepet edited reviewers, added: xazax.hun, szepet; removed: dergachev.a. szepet added a comment. Herald added a subscriber: rnkovacs. Hi Alexey! Thank you for working on this! Some general comments on the patch:

[PATCH] D41151: [analyzer] Adding LoopContext and improve loop modeling

2017-12-12 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. szepet added reviewers: dcoughlin, NoQ, zaks.anna, xazax.hun, a.sidorin. Herald added subscribers: dkrupp, baloghadamsoftware, whisperity. Based on the CFGLoopEntrance element, it is possible to have a CFG driven LocationContext update which contains loop information

[PATCH] D41150: [CFG] Adding new CFGStmt LoopEntrance for the StaticAnalyzer

2017-12-12 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. szepet added reviewers: dcoughlin, zaks.anna, NoQ, rsmith. Herald added subscribers: dkrupp, a.sidorin, baloghadamsoftware, whisperity. Adding LoopEntrance as a new CFGElement to the CFG. This element is added as the last element of the CFGBlock just before the loop

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-07 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. In https://reviews.llvm.org/D40937#947760, @JVApen wrote: > How does this check deal with atomic members? > ... This patch only works on integer types. So, since the atomic is a non-supported type the check will skip that `while` loop. https://reviews.llvm.org/D40937

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-07 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 125965. szepet marked 9 inline comments as done. szepet added a comment. Updates based on comments. https://reviews.llvm.org/D40937 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/InfiniteLoopCheck.cpp clang-tidy/misc/InfiniteLoopCheck.h clang-

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Hi Eugen! Good question, probably should have detailed it in the description. This matcher based solution would not gain much benefit from the symbolic execution provided information. (I mean, it would mean a much different type of check on the states.) The main problems

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 125870. szepet marked an inline comment as done. szepet added a comment. Updated the wording in the docs. https://reviews.llvm.org/D40937 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/InfiniteLoopCheck.cpp clang-tidy/misc/InfiniteLoopCheck.h

[PATCH] D40937: [clang-tidy] Infinite loop checker

2017-12-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: rnkovacs, baloghadamsoftware, whisperity, mgorny. The checker aims to find loops where none of the condition variables are updated in the body. In this version it only works on integer types but the final aim is to make it work for objects

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-12-01 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added reviewers: alexfh, aaron.ballman. szepet added a comment. Added Alexander and Aaron as reviewers for the matcher parts. https://reviews.llvm.org/D38921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2017-11-29 Thread Peter Szecsi via Phabricator via cfe-commits
szepet marked an inline comment as done. szepet added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:611 + EXPECT_TRUE(testImport("template struct S;" + "template void declToImport() {" + " S::foo;" -

[PATCH] D38843: [ASTImporter] Support importing CXXPseudoDestructorExpr

2017-11-24 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 124173. szepet marked 3 inline comments as done. szepet added a comment. Herald added a subscriber: rnkovacs. Thank you for the review! Updated according to review comments. https://reviews.llvm.org/D38843 Files: lib/AST/ASTImporter.cpp unittests/AST/AS

[PATCH] D38694: [ASTImporter] Support importing CXXUnresolvedConstructExpr and UnresolvedLookupExpr

2017-11-23 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 124123. szepet added a comment. Updating the usage of `ImportTemplateArgumentListInfo`. https://reviews.llvm.org/D38694 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp ===

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2017-11-23 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 124119. szepet marked 6 inline comments as done. szepet added a comment. Herald added a subscriber: rnkovacs. Updated based on review comments. Hello Aleksei, Thank for the review and the code snippet as well! https://reviews.llvm.org/D38845 Files: lib/AS

[PATCH] D38694: [ASTImporter] Support importing CXXUnresolvedConstructExpr and UnresolvedLookupExpr

2017-11-23 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Hello Aleksei, Thank you for the review! (and sorry for the late update) Comment at: lib/AST/ASTImporter.cpp:5510 + UnresolvedSet<8> ToDecls; + for (Decl *D : E->decls()) { +if (NamedDecl *To = cast_or_null(Importer.Import(D))) a.

[PATCH] D38694: [ASTImporter] Support importing CXXUnresolvedConstructExpr and UnresolvedLookupExpr

2017-11-23 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 124115. szepet marked 7 inline comments as done. szepet added a comment. Herald added a subscriber: rnkovacs. Updates based on review comments. https://reviews.llvm.org/D38694 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unitt

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-11-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 123187. szepet marked 2 inline comments as done. szepet added a comment. Testfiles added and HTML updated. https://reviews.llvm.org/D38921 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-11-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 123176. szepet added a reviewer: klimek. szepet added a comment. Herald added subscribers: a.sidorin, rnkovacs. isAssignmentOp matcher moved to ASTMatchers.h (Manuel added to reviewers as the code owner of ASTMatchers) https://reviews.llvm.org/D38921 Files:

[PATCH] D38674: [analyzer] MisusedMovedObjectChecker: More precise warning message

2017-10-28 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316852: [analyzer] MisusedMovedObjectChecker: More precise warning message (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D38674?vs=118170&id=120737#toc Repository: rL LLVM

[PATCH] D38922: [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)

2017-10-28 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316830: [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943) (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D38922?vs=119019&id=120733#toc Repository: r

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-10-28 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 120732. szepet added a comment. Updated to use a custom AST matcher for assignment operator check. (More structured and efficient.) https://reviews.llvm.org/D38921 Files: lib/StaticAnalyzer/Core/LoopUnrolling.cpp test/Analysis/loop-unrolling.cpp Index:

[PATCH] D39398: [CFG][Analyzer] Add LoopExit element to the CFG in more cases

2017-10-27 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 120726. szepet added a comment. Just removed some accidentally left changes from the patch. https://reviews.llvm.org/D39398 Files: include/clang/Analysis/CFG.h lib/Analysis/CFG.cpp test/Analysis/loopexit-cfg-output.cpp Index: test/Analysis/loopexit-cf

[PATCH] D39398: [CFG][Analyzer] Add LoopExit element to the CFG in more cases

2017-10-27 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. This patch adds a LoopExit element to the CFG whenever a loop is exited by a ReturnStmt, GotoStmt or IndirectGotoStmt. The LoopExit element is consumed by the Static Analyzer in order to simulate the loops mo

[PATCH] D38842: [CrossTU] Fix handling of Cross Translation Unit directory path

2017-10-27 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. LGTM as well, but same note applies. https://reviews.llvm.org/D38842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38843: [ASTImporter] Support importing CXXPseudoDestructorExpr

2017-10-19 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 119579. szepet added a comment. Checking for importing base updated to (!Imported && From) style. https://reviews.llvm.org/D38843 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp

[PATCH] D38843: [ASTImporter] Support importing CXXPseudoDestructorExpr

2017-10-19 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: lib/AST/ASTImporter.cpp:5549 + Expr *BaseE = Importer.Import(E->getBase()); + if (!BaseE) +return nullptr; xazax.hun wrote: > Does `E->getBase()` guaranteed to return non-null? What happens when this > node was con

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2017-10-19 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: lib/AST/ASTImporter.cpp:5500 + + TemplateArgumentListInfo ToTAInfo; + TemplateArgumentListInfo *ResInfo = nullptr; xazax.hun wrote: > According to phabricator this code is very similar to a snippet starting from > line

[PATCH] D38675: [analyzer] MisusedMovedObjectChecker: Moving the checker out of alpha state

2017-10-14 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 119032. szepet added a comment. Test file (running line) update. https://reviews.llvm.org/D38675 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td test/Analysis/MisusedMovedObject.cpp Index: test/Analysis/MisusedMovedObject.cpp =

[PATCH] D38922: [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)

2017-10-14 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. The loop unrolling feature aims to track the maximum possible steps a loop can make. In order to implement this, it investigates the initial value of the counter variable and the bound number. (There has to b

[PATCH] D38921: [analyzer] LoopUnrolling: update the matched assignment operators

2017-10-14 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. Extended the matched assignment operators when checking for bound changes in a body of the loop. This updated list covers all the (current) possible assignments. https://reviews.llvm.org/D38921 Files: li

[PATCH] D38845: [ASTImporter] Support importing UnresolvedMemberExpr, DependentNameType, DependentScopeDeclRefExpr

2017-10-12 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. The visit callback implementations for the 3 C++ AST Node added to the ASTImporter. Note: Based on: https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp https://reviews.llvm.org/D38845 Files: lib/AST/ASTImporter.cpp unittests/AST/AS

[PATCH] D38843: [ASTImporter] Support importing CXXPseudoDestructorExpr

2017-10-12 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Adding VisitCXXPseudoDestructorExpr callback to the ASTImporter. Note: This is based on: https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp#L7624 . https://reviews.llvm.org/D38843 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTIm

[PATCH] D38694: [ASTImporter] Support importing CXXUnresolvedConstructExpr and UnresolvedLookupExpr

2017-10-09 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. This patch adds support for importing two different kind of C++ AST Node. Note: This solution is based on https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp#L7605 . https://reviews.llvm.org/D38694 Files: lib/AST/ASTImporter.cpp uni

[PATCH] D38675: [analyzer] MisusedMovedObjectChecker: Moving the checker out of alpha state

2017-10-08 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. First, I am not exactly sure what are the requirements for moving a checker out of alpha. However, the checker seems to work with a low false positive rate. (<15 on the LLVM, 6 effectively different) Also fou

[PATCH] D38674: [analyzer] MisusedMovedObjectChecker: More precise warning message

2017-10-08 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. Added new enum in order to differentiate the warning messages on "misusing" into 3 categories: function calls, moving an object, copying an object. (At the moment the checker gives the same message in case of

[PATCH] D37897: [StaticAnalyzer] Fix ProgramState for static variables that are not written

2017-10-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Hello Daniel! It is a great feature to add, thanks for working on this! I have just small comments (rather questions) on the code. Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:155 + Children.push(FuncBody); + while (!Children.empty()) { +con

[PATCH] D31538: [analyzer] MisusedMovedObjectChecker: Fix a false positive on state-resetting a base-class sub-object.

2017-10-06 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Hello Artem! Could you please commit these changes? (And https://reviews.llvm.org/D31541 as well.) Thanks in advance! https://reviews.llvm.org/D31538 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[PATCH] D32981: [ASTImporter] Improve handling of incomplete types

2017-10-05 Thread Peter Szecsi via Phabricator via cfe-commits
szepet closed this revision. szepet added a comment. This patch was commited in r302975. (https://reviews.llvm.org/rL302975) https://reviews.llvm.org/D32981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

[PATCH] D37572: [clang-tidy] SuspiciousEnumUsageCheck bugfix

2017-09-12 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL313016: [clang-tidy] SuspiciousEnumUsageCheck bugfix (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D37572?vs=114567&id=114788#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D37572: [clang-tidy] SuspiciousEnumUsageCheck bugfix

2017-09-11 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 114567. szepet marked 3 inline comments as done. szepet added a comment. Updates based on the comments. Thanks for the reduced test case and the fast review! Not sure if in these cases am I allowed to commit (since it was accepted) or since it was accepted a

[PATCH] D37572: [clang-tidy] SuspiciousEnumUsageCheck bugfix

2017-09-07 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity, JDevlieghere. There is a reported bug on the checker not handling the some APSInt values correctly: https://bugs.llvm.org/show_bug.cgi?id=34400 This patch fixes it, however, it shows a false positive. (Added

[PATCH] D37187: [Analyzer] Fix Bug 25609 - Assertion UNREACHABLE: 'Unexpected ProgramPoint' with widen-loops=true

2017-08-31 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Thanks for the update! It looks good to me! (Probably somebody else (most likely NoQ) will have some additional comment but I think it's great!) https://reviews.llvm.org/D37187 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D37187: [Analyzer] Fix Bug 25609 - Assertion UNREACHABLE: 'Unexpected ProgramPoint' with widen-loops=true

2017-08-30 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a reviewer: szepet. szepet edited subscribers, added: cfe-commits; removed: szepet. szepet added a comment. Hello MTC, Thanks for working on this! I planned to add a change like this in D36690 but it worths an individual patch (did not know it was

[PATCH] D37181: {StaticAnalyzer} LoopUnrolling: Keep track the maximum number of steps for each loop

2017-08-28 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311883: [StaticAnalyzer] LoopUnrolling: Keep track the maximum number of steps for each… (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D37181?vs=112866&id=112877#toc Repositor

[PATCH] D36962: [StaticAnalyzer] LoopUnrolling: Excluding loops which splits the state (make more branches)

2017-08-28 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311881: [StaticAnalyzer] LoopUnrolling: Excluding loops which splits the state (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D36962?vs=112710&id=112874#toc Repository: rL LL

[PATCH] D37103: [StaticAnalyzer] LoopUnrolling fixes

2017-08-28 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311880: [StaticAnalyzer] LoopUnrolling fixes (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D37103?vs=112824&id=112872#toc Repository: rL LLVM https://reviews.llvm.org/D3710

[PATCH] D37181: {StaticAnalyzer} LoopUnrolling: Keep track the maximum number of steps for each loop

2017-08-28 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 112866. szepet marked an inline comment as done. szepet added a comment. Updated to use static int. https://reviews.llvm.org/D37181 Files: include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h lib/StaticAnalyzer/Core/ExprEngine.cpp lib/Static

[PATCH] D37103: [StaticAnalyzer] LoopUnrolling fixes

2017-08-27 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 112824. szepet added a comment. Update based on comments. https://reviews.llvm.org/D37103 Files: lib/StaticAnalyzer/Core/AnalysisManager.cpp lib/StaticAnalyzer/Core/ExprEngine.cpp lib/StaticAnalyzer/Core/LoopUnrolling.cpp test/Analysis/loop-unrolling

[PATCH] D37181: {StaticAnalyzer} LoopUnrolling: Keep track the maximum number of steps for each loop

2017-08-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet created this revision. Herald added subscribers: baloghadamsoftware, whisperity. This way the unrolling can be restricted for loops which will take at most a given number of steps. It is defined as 128 in this patch and it seems to have a good number for that purpose. https://reviews.ll

[PATCH] D35670: [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer

2017-08-21 Thread Peter Szecsi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL311344: [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer (authored by szepet). Changed prior to commit: https://reviews.llvm.org/D35670?vs=110981&id=111993#toc Repository: rL LLVM https:/

[PATCH] D35670: [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer

2017-08-14 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: include/clang/Analysis/ProgramPoint.h:658 +class LoopExit : public ProgramPoint { +public: dcoughlin wrote: > Can you add a comment explaining what meaning of this program point is. Can you help me with that? I am not s

[PATCH] D35670: [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer

2017-08-14 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 110981. szepet marked an inline comment as done. szepet added a comment. Updates based on comments. https://reviews.llvm.org/D35670 Files: include/clang/Analysis/ProgramPoint.h include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib/StaticAnal

[PATCH] D35670: [StaticAnalyzer] Handle LoopExit CFGElement in the analyzer

2017-07-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 108312. szepet added a subscriber: cfe-commits. szepet added a comment. Accidentally left debug print removed. https://reviews.llvm.org/D35670 Files: include/clang/Analysis/ProgramPoint.h include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib

[PATCH] D34260: [StaticAnalyzer] Completely unrolling specific loops with known bound option

2017-07-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet closed this revision. szepet added a comment. So the fixes seem to work. The problem was the line 'StackFrame = StackFrame->getParent()->getCurrentStackFrame();' since I havent checked if the parent of the StackFrame is nullptr. (It is quite interesting that it just not crashed on my com

[PATCH] D34260: [StaticAnalyzer] Completely unrolling specific loops with known bound option

2017-07-26 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. In https://reviews.llvm.org/D34260#821186, @teemperor wrote: > Try fixing this invalid read and the buildbots (and my builds :) ) should be > working again. Yeah, thanks for the help! :) I already sent a fix for that: https://reviews.llvm.org/rL309036 and another one:

[PATCH] D34260: [StaticAnalyzer] Completely unrolling specific loops with known bound option

2017-07-25 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. In https://reviews.llvm.org/D34260#819721, @NoQ wrote: > ... and add the extra run-line that'd show you the backtrace. We made > changes, so the issue might have been wiped out accidentally (or maybe you're > actually right!), and if it wasn't, at least we'd have the ba

[PATCH] D34260: [StaticAnalyzer] Completely unrolling specific loops with known bound option

2017-07-24 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 107976. szepet added a subscriber: cfe-commits. szepet added a comment. Accidentally left typo removed. OK so I am not sure but am I allowed to commit it again? I mean I made some notable changes. Not on the functionality of the feature but the stored data. So

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-07-13 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Hello Maxim! Thanks for working on this! > Ugh, yeah, SwitchStmt is tricky (thank you for pointing to Duff's device > example!). I've tried to resolve several issues with switch revealed by this > testcase, but didn't succeed for now :(. So, it was decided to remove > S

[PATCH] D32751: [ASTImporter] Support new kinds of declarations (mostly Using*)

2017-05-28 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Some nits added, other than these it looks good to me. Thank you! Just more one question, I can see 3 different cases how the import returns are handled: - if(!ToDecl) return nullptr; - if(!ToDecl && FromDecl) return nullptr; - no handling: ObjectXY::Create(...Import(Fro

[PATCH] D32751: [ASTImporter] Support new kinds of declarations (mostly Using*)

2017-05-16 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: lib/AST/ASTImporter.cpp:1464 + + NamespaceDecl *TargetDecl = cast( +Importer.Import(D->getNamespace())); Since the Import can result nullptr (which is checked 2 lines below) this should be a cast_or_null as I se

[PATCH] D31538: [analyzer] MisusedMovedObjectChecker: Fix a false positive on state-resetting a base-class sub-object.

2017-04-15 Thread Peter Szecsi via Phabricator via cfe-commits
szepet accepted this revision. szepet added inline comments. This revision is now accepted and ready to land. Comment at: lib/StaticAnalyzer/Checkers/MisusedMovedObjectChecker.cpp:426 + +State = State->remove(WholeObjectRegion); C.addTransition(State); s

[PATCH] D31541: [analyzer] MisusedMovedObjectChecker: Add a printState() method.

2017-03-31 Thread Peter Szecsi via Phabricator via cfe-commits
szepet accepted this revision. szepet added a comment. This revision is now accepted and ready to land. LGTM, thank you (again)! https://reviews.llvm.org/D31541 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

[PATCH] D31538: [analyzer] MisusedMovedObjectChecker: Fix a false positive on state-resetting a base-class sub-object.

2017-03-31 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MisusedMovedObjectChecker.cpp:426 + +State = State->remove(WholeObjectRegion); C.addTransition(State); szepet wrote: > I am wondering if I made a mistake but I think this should be >

[PATCH] D31538: [analyzer] MisusedMovedObjectChecker: Fix a false positive on state-resetting a base-class sub-object.

2017-03-31 Thread Peter Szecsi via Phabricator via cfe-commits
szepet added a comment. Thank you for working on that, Artem! The changes look good, just one comment about that suspicious remove. Comment at: lib/StaticAnalyzer/Checkers/MisusedMovedObjectChecker.cpp:426 + +State = State->remove(WholeObjectRegion); C.addTransition(St

[PATCH] D22507: Clang-tidy - Enum misuse check

2016-12-25 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 82488. szepet marked 6 inline comments as done. szepet added a comment. The requested changes have been made. Some more refactor on the Case2 since it is the same as the LHS/RHS case. Moved more common statements out of the branch (Case2-3) for better readabil

[PATCH] D22507: Clang-tidy - Enum misuse check

2016-12-17 Thread Peter Szecsi via Phabricator via cfe-commits
szepet updated this revision to Diff 81848. szepet added a comment. Herald added a subscriber: JDevlieghere. Minor changes to improve the readability of the code according to comments. https://reviews.llvm.org/D22507 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

  1   2   >