[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. This patch supersedes both https://reviews.llvm.org/D32905 and https://reviews.llvm.org/D54149. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70818/new/ https://reviews.llvm.org/D70818

[PATCH] D32905: [Analyzer] Iterator Checker - Part 9: Evaluation of std::find-like calls

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Herald added subscribers: Charusso, gamesh411. The STL `find()` family is modeled in a separate checker: [[ https://reviews.llvm.org/D70818 | [Analyzer] Model STL Algoirthms to improve the iterator checkers ]]

[PATCH] D68165: [analyzer][MallocChecker][NFC] Split checkPostCall up, deploy CallDescriptionMap

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:865 + if (FreeingMemFnMap.lookup(Call)) return true; baloghadamsoftware wrote: > Maybe `return !!FreeingMemFnMap.lookup(Call)`? I think the code

[PATCH] D70320: [Analyzer] [NFC] Iterator Checkers - Separate iterator modeling and the actual checkers

2019-11-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done and an inline comment as not done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:1308-1318 +ProgramStateRef removeIteratorPosition(ProgramStateRef State, const

[PATCH] D70320: [Analyzer] [NFC] Iterator Checkers - Separate iterator modeling and the actual checkers

2019-11-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:1308-1318 +ProgramStateRef removeIteratorPosition(ProgramStateRef State, const SVal ) { if (auto Reg =

[PATCH] D70244: [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a conjured value

2019-11-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. @NoQ, @Szelethus What about this patch? It is an essential bugfix. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70244/new/ https://reviews.llvm.org/D70244 ___ cfe-commits mailing

[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

2019-09-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 221300. baloghadamsoftware added a comment. Updated according to the comment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64736/new/ https://reviews.llvm.org/D64736 Files: clang-tidy/bugprone/BugproneTidyModule.cpp

[PATCH] D67156: [Analyzer] Debug Checkers for Container and Iterator Inspection

2019-10-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 222984. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67156/new/ https://reviews.llvm.org/D67156 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2019-10-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D62525#1609334 , @NoQ wrote: > Ok, so is it problematic to define a lambda that checks whether an > interesting iterator is invalidated? Or is it difficult to return the note > tag from many stack frames in order

[PATCH] D67156: [Analyzer] Debug Checkers for Container and Iterator Inspection

2019-10-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 6 inline comments as done. baloghadamsoftware added inline comments. Comment at: include/clang/StaticAnalyzer/Checkers/Checkers.td:1328-1337 +def ContainerInspectionChecker : Checker<"ContainerInspection">, + HelpText<"Check the analyzer's

[PATCH] D68165: [analyzer][MallocChecker][NFC] Split checkPostCall up, deploy CallDescriptionMap

2019-10-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:378-379 + + using CheckFn = void (MallocChecker::*)(CheckerContext , const CallExpr *CE, + ProgramStateRef State) const; +

[PATCH] D68162: [analyzer][MallocChecker][NFC] Communicate the allocation family to auxiliary functions with parameters

2019-10-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I like this change. If we can retrieve something with a simple getter, then do not carry extra parameters all over the code. However, if we have to recalculate something over and over again then it is much better to determine it once and pass it around as a

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244380. baloghadamsoftware added a comment. In case of multiple container-related bugs only mark the container interesting on the correct bug path. Also a typo fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D73720#1871955 , @Szelethus wrote: > Do we have a test where 2 containers are present but only one of them should > be marked as interesting? Yes, of course we have, that was the starting point of the discussion.

[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2020-02-26 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. Iterator checkers (and

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1830792 , @gribozavr2 wrote: > Let me know if you want me to commit this change for you. Thank you! I will commit it today. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfccd0da5ee6f: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D71001?vs=239103=239290#toc

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-01-21 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hello, This checker is an alternative approach to our not yet published statistics-based checkers in a way: 2019 EuroLLVM Developers’ Meeting: A. Balogh “Statistics Based Checkers in the Clang Static Analyzer”

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75514#1905268 , @Szelethus wrote: > But why is this related to `UndefinedVal`? Because `UndefinedVal` seems to be the "null" value of `SVal` thus it is suitable for default value of the parameter. CHANGES SINCE

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.

[PATCH] D75271: [analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions.

2020-03-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. I think this is straightforward after D75360 . This was my original attempt as well, but without D75360 it did not work. This solves the problem of

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of te affected container

2020-03-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 247910. baloghadamsoftware added a comment. Alternative approach for debugging (instead of checking the source range): `clang_analyzer_express()` from `ExprInspection` marks its argument as interesting in the bug report. `DebugContainerModeling`

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of te affected container

2020-03-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 247934. baloghadamsoftware added a comment. Updated according to the style comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files:

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 247856. baloghadamsoftware added a comment. Back to the version where we do not check for interestingness. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of te affected container

2020-03-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.

[PATCH] D75271: [Analyzer][NFC] Add AnalyzerOptions parameter to shouldRegisterXXX() functions

2020-02-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75271#1896724 , @Szelethus wrote: > Let's change this to either `CheckerManger` or `AnalysisManager`. Did you read my comments? I tried `CheckerManager` first, but it does not work, because `CheckerRegistry` does

[PATCH] D75271: [Analyzer][NFC] Add AnalyzerOptions parameter to shouldRegisterXXX() functions

2020-02-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: Szelethus, NoQ. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, phosek, Charusso, gamesh411, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.

[PATCH] D75271: [analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions.

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. It is even worse: the `shouldRegister()` functions do not prevent the registration of a checker, at least in cases when they are not enabled directly but via dependencies. See D75171 . CHANGES SINCE LAST ACTION

[PATCH] D74760: [Analyzer] Fix for iterator modeling and checkers: handle negative numbers correctly

2020-02-25 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG770ad9f55e66: [Analyzer] Fix for iterator modeling and checkers: handle negative numbers… (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-02-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 246425. baloghadamsoftware added a comment. Herald added subscribers: martong, steakhal. Minor update. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files:

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-02-25 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:43 +static bool isLiteral(const Expr *E) { + return isa(E) || + isa(E) ||

[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2020-02-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75171#1893811 , @Szelethus wrote: > Im sorry, i though we talked about internal code and we're stuck with the > checker interface -- this should definitely be solved by changing the > parameter of the

[PATCH] D75271: [Analyzer][NFC] Add AnalyzerOptions parameter to shouldRegisterXXX() functions

2020-02-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. It is impossible to use `CheckerManager` as parameter for `shouldRegisterXXX()` because `CheckerRegistry` does not have it. If I add `CheckerManager` to `CheckerRegistry` then the `printXXX()` functions will not work because they do not have `CheckerManager`

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG70f4c6e7b14f: [clan-tidy] Fix false positive in bugprone-infinite-loop (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Should I also commit it to the release 10.0 branch? This is a bugfix so it should be fixed in the release, I think. I added a dependency between this bug and the 10.0.0 release blockers. Is that enough? Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D73270: [clan-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: gribozavr2. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, gamesh411, Szelethus, rnkovacs, whisperity. Herald added a project: clang. The checker `bugprone-infinite-loop` does

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2020-01-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 241364. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70818/new/ https://reviews.llvm.org/D70818 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added a comment. In D70818#1860115 , @Szelethus wrote: > I dont think any of my comments were addressed -- could you follow up? I addressed two, added fixme for another one. Now I

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-01-30 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. Container operations such as `push_back()`,

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-02-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Please add tests for all the functions in the list. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72705/new/ https://reviews.llvm.org/D72705 ___ cfe-commits mailing

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb198f16e1e1c: [Analyzer] Model STL Algoirthms to improve the iterator checkers (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D70818?vs=242607=242647#toc

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:186 +} + } + gribozavr2 wrote: > I think this logic should go into `isChanged()`,

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-23 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 239927. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 240192. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 240195. baloghadamsoftware added a comment. Minor fix. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73270/new/ https://reviews.llvm.org/D73270 Files: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp

[PATCH] D73270: [clang-tidy] Fix false positive in bugprone-infinite-loop

2020-01-24 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:186 +} + } + gribozavr2 wrote: > baloghadamsoftware wrote: > > gribozavr2 wrote: > > > I

[PATCH] D73547: [Analyzer] Split container modeling from iterator modeling

2020-01-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D73547#1845339 , @NoQ wrote: > This patch is simply moving code around, right? If so, why did tests need to > be removed? All of the container begin- and end-tests were removed from `iterator-modeling.cpp` and

[PATCH] D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.

2020-01-27 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Please consider the following test cases: void test_NullCorrectCheck3() { void *P = aligned_alloc(4, 8); use(*P); // A developer inserted this line before the check by mistake. This will be a null pointer dereference. if (P == NULL) { } }

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 242323. baloghadamsoftware added a comment. `const SVal &` -> `SVal` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 242607. baloghadamsoftware added a comment. Updated: checker moved to alpha.cplusplus (until at least one of the iterator-related checkers gets out of alpha state or a new non-alpha container checker is created). Error-branch is protected by an

[PATCH] D70818: [Analyzer] Model STL Algoirthms to improve the iterator checkers

2020-02-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/STLAlgorithmModeling.cpp:138-139 + SVB.getConditionType()); +assert(Less.getAs() && + "Symbol

[PATCH] D62525: [Analyzer] Add new visitor to the iterator checkers

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Superseded by [[ https://reviews.llvm.org/D73720 | [Analyzer] Use note tags to track container begin and and changes ]], [[ https://reviews.llvm.org/D74541 | [Analyzer] Use note tags to track iterator increments and

[PATCH] D74615: [Analyzer] Add visitor to track iterator invalidation

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: steakhal, Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun. To understand the bug report issued by the

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-14 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 244667. baloghadamsoftware added a comment. Minor update: ignore parentheses and casts when taking the name of the expression. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D74760: [Analyzer] Fix for iterator modeling and checkers: handle negative numbers correctly

2020-02-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: steakhal, Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity. Currently, using negative numbers in

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243796. baloghadamsoftware added a comment. First real checker `IteratorRange` now marks container as interesting to benefit from container note tags. The other two iterator checkers will be updated after a second phase of container note tags

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:731 + } + return C.getNoteTag([Text, Name](BugReport ) -> std::string { + SmallString<256> Msg;

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-02-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 243571. baloghadamsoftware added a comment. Only track the right container. Furthermore, minor updates according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files:

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D74735#1880390 , @xazax.hun wrote: > If the AST is hard to work with would it make sense to try to change the AST > a bit? Hmm, you mean making `CXXConstructExpr` an abstract base with subclasses

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238192. baloghadamsoftware retitled this revision from "[clang-tidy][WIP] New check readability-prefer-initialization-list" to "[clang-tidy][WIP] New check cppcoreguidelines-prefer-initialization-list". baloghadamsoftware added a comment. Herald

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 6 inline comments as done. baloghadamsoftware added a comment. Thank you for the comments. Comment at: clang-tools-extra/docs/ReleaseNotes.rst:70 +- The 'readability-prefer-member-initializer' check was renamed to

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-15 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238219. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files:

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-member-initializer

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238527. baloghadamsoftware retitled this revision from "[clang-tidy] New check cppcoreguidelines-prefer-initialization-list" to "[clang-tidy] New check cppcoreguidelines-prefer-initializer". baloghadamsoftware added a comment. Indentation of the

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238528. baloghadamsoftware added a comment. Indentation of the code fixed in the documentation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files:

[PATCH] D71199: [clang-tidy] New check cppcoreguidelines-prefer-initialization-list

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238449. baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files:

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-16 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 238451. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files:

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added a comment. Hello, Thank you for your useful comments. I think I fixed them all now. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001

[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2020-01-20 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 239103. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71001/new/ https://reviews.llvm.org/D71001 Files:

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249897. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 3 inline comments as done. baloghadamsoftware added a comment. In D75514#1917450 , @Szelethus wrote: > The code from in `ExprInspectionChecker.cpp` is duplicated from D75677 > , isn't it? It

[PATCH] D75851: [Analyzer][StreamChecker] Added evaluation of fseek.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:382-384 + C.addTransition(StateNotFailed); + C.addTransition(StateFailedWithFError); + C.addTransition(StateFailedWithoutFError); Szelethus wrote: >

[PATCH] D75360: [analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I do not say I fully grab every single character, but basically it looks good to me. @NoQ, please take a look on this, you are more competent in finding issues with it. This patch is needed to my patch preventing registration of checkers that depend on an

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:43 +EofError, /// EOF condition (`feof` is true). +OtherError, /// Other (non-EOF) error (`ferror` is true). +AnyError/// EofError or OtherError, used if

[PATCH] D75045: [analyzer] Improved check of `fgetc` in StreamChecker.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/test/Analysis/stream.c:188 +C = fgetc(fp); +fread(0, 0, 0, fp); // expected-warning {{Should call}} +fread(0, 0, 0, fp); Szelethus wrote: > balazske wrote: > > Szelethus wrote: > > > Are we

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75682#1916809 , @balazske wrote: > What is better? Have this (or similar) change that adds a feature that is > used in a later change and is only testable in that later change, or have a > bigger change that

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:33-45 + enum KindTy { +Opened, /// Stream is opened. +Closed, /// Closed stream (an invalid stream pointer after it was closed). +OpenFailed /// The last open

[PATCH] D75682: [Analyzer][StreamChecker] Introduction of stream error handling.

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:33-45 + enum KindTy { +Opened, /// Stream is opened. +Closed, /// Closed stream (an invalid stream pointer after it was closed). +OpenFailed /// The last open

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249319. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files:

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp:143 + std::string Diags; + EXPECT_TRUE(runCheckerOnCode("void f() {;}", Diags)); +}

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249320. baloghadamsoftware added a comment. Rebased. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75677/new/ https://reviews.llvm.org/D75677 Files: clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp

[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2020-03-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249352. baloghadamsoftware added a comment. Tests reduced. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75171/new/ https://reviews.llvm.org/D75171 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp:719-720 + const auto *PSBR = dyn_cast(); + if (!PSBR) +return ""; + NoQ wrote: >

[PATCH] D75271: [analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions.

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware requested changes to this revision. baloghadamsoftware added a comment. This revision now requires changes to proceed. This patch still does not help. Most of the functions of `CheckerManager` are non-const thus they cannot be called on a const object. E.g.

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248496. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248495. baloghadamsoftware added a comment. Minor style change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D75677: [Analyzer] Only add iterator note tags to the operations of the affected iterators

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248509. baloghadamsoftware added a comment. Updated according to the comments to D75514 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75677/new/ https://reviews.llvm.org/D75677 Files:

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248502. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Typo fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files:

[PATCH] D75514: [Analyzer] Only add container note tags to the operations of the affected container

2020-03-05 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 248499. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https://reviews.llvm.org/D75514 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp

[PATCH] D75839: [Analyzer] Mark constant member functions const in CheckerManager

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Most

[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249043. baloghadamsoftware added a comment. Correct diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75171/new/ https://reviews.llvm.org/D75171 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td

[PATCH] D73720: [Analyzer] Use note tags to track container begin and and changes

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I wonder whether I should change "to/from the left" to "towards/from the front" and "to/from the right" to "towards/from the right"? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73720/new/ https://reviews.llvm.org/D73720

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75842#1912293 , @xazax.hun wrote: > I am not sure if I would call this a bugfix. Enabling a checker without one > of its dependency will potentially cause the checker to misbehave. I am > uncomfortable changing

[PATCH] D75271: [analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions.

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. This revision is now accepted and ready to land. OK, I agree, these issues should be solved in other patches. I already solved one, but the other one is strange. I will open a BugZilla ticket for it. CHANGES SINCE

[PATCH] D75360: [analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/CheckerManager.h:178 + const CheckerRegistry () { return Registry; } + DiagnosticsEngine () { return Diags; } Please mark these getters as `const`. CHANGES SINCE

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. I looked in the `unittests` directory but could not find tests for dependency handling. @Szelethus, feel free to commandeer this patch if you know how to test it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D75842#1912246 , @xazax.hun wrote: > If we disable the dependency of a checker explicitly I think we should at > least emit a warning. I agree, but I do not thik that this should be part of this patch. This is

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, Szelethus. baloghadamsoftware added a project: clang. Herald added subscribers: martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity.

[PATCH] D75839: [Analyzer] Mark constant member functions const in CheckerManager

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG57f70d187706: [Analyzer] Mark constant member functions const in CheckerManager (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

<    1   2   3   4   5   6   7   8   9   10   >