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

2020-03-27 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/IteratorModeling.cpp:541-542 +BR.markInteresting(It1); +if (const auto &LCV1 = It1.getAs()) { + BR.markInteresting

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

2020-03-30 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGafcb77cc88a2: [Analyzer] Fix for incorrect use of container and iterator checkers (authored by baloghadamsoftware). Herald added a subscriber: ASDenysPetrov. Changed prior to commit: https://reviews.llv

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-03-31 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: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, wh

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-03-31 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: ASDenysPetrov, martong, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, wh

[PATCH] D77229: [Analyzer][WIP] Avoid handling of LazyCompundVals in IteratorModeling

2020-04-01 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Testing this patch on `test/Analysis/iterator-modeling.cpp` crashes with the following output: Handling operator++() Return Value: lazyCompoundVal{0x55655390c9d8,i1} Bingo! State->get(Key): &i1 Key.getItem().getKind(): 0 clang: /home/edmbalo/l

[PATCH] D77229: [Analyzer][WIP] Avoid handling of LazyCompundVals in IteratorModeling

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

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-04-01 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:780 + if (AggressiveEraseModeling) { +if (const auto *CData = getContainerData(State, ContReg)) {

[PATCH] D77125: [Analyzer] Model return values of container insert and delete operations

2020-04-01 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D77125#1952769 , @martong wrote: > It seems like we could model here `emplace` and `emplace_after` exactly the > same way we do with `insert` and `insert_after`, couldn't we? Perhaps that > could go into this patch

[PATCH] D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling

2020-04-03 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:692-699 + std::tie(StateEnd, StateNotEnd) = State->assume(*RetEnd); + if (StateEnd) { +

[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: clang-tools-extra/clang-tidy/cppcore

[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] 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 https://revie

[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 pl

[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. Herald

[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 `shouldRegist

[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] 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] 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 b

[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: clang/lib/StaticAnalyzer/Checker

[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. baloghadamsoft

[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` p

[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: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cp

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-07 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Thank you for working on this. Please add comments to the code and maybe also to the tests. I could not find anything in the standards about `freopen()` with null-pointer for the stream parameter. Comment at: clang/lib/StaticAnalyzer/Checke

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

2019-11-08 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. baloghadamsoftware marked an inline comment as done. Closed by commit rG0f88caeef8f2: [Analyzer] Checker for Debugging Iterator Checkers (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/

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

2019-11-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: Charusso, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity. Sometimes the return value of a comparison

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-19 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:176 + const LocationContext *LCtx = C.getPredecessor()->getLocationContext(); + ConstraintManager &CM = C.getConstraintManager(); + auto *CE = dyn_cast_or_null(Call.getOri

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

2019-11-19 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/IteratorModeling.cpp:1308-1318 +ProgramStateRef removeIteratorPosition(ProgramStateRef State, const SVal &Val) { if (auto Reg = Val.get

[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 SVal

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-11-28 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:201 +std::tie(StateRetNotNull, StateRetNull) = +CM.assumeDual(StateStreamNull, RetVal); +if (StateRetNull) { balazske wrote: > NoQ wrote: > >

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

2019-11-28 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, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, xazax.hun, whisperity, mgorny. baloghadamsoftware added a parent re

[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 &Val) { if (auto Reg = Val.get

[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] 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 ]] CHAN

[PATCH] D54149: [Analyzer] [WIP] Standard C++ library functions checker for the std::find() family

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The modeling framework in its current state cannot be used for detailed modeling of complex functions. Even detailed modeling (including handling of `GDM` data for checkers) of standard C functions are done manually: see `C string` and `stream` checkers. Temp

[PATCH] D49074: [Analyzer] Basic support for multiplication and division in the constraint manager

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. We have applied this patch in our internal release and our users have used it for more than half a year without any problems: no crashes, no freezes and no suspicious false positives caused by it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D49074/n

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-11-29 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, gamesh411, Szelethus, rnkovacs, xazax.hun, whisperity. Herald added a project: clang. Applying parentheses

[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 chan

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-12-01 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D70850#1764469 , @aaron.ballman wrote: > LGTM, but we may have other things to test (or bugs to fix) here. Oh yes, this check seems a bit incomplete, more statements are missing, but this particular issue was a sh

[PATCH] D70850: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804

2019-12-01 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG497a754adeca: [Clang-Tidy] Quick fix for bug in bugprone-macro-parentheses 43804 (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D70912: [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions when printing the Program State

2019-12-02 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 231738. baloghadamsoftware added a comment. Wrong diff uploaded. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70912/new/ https://reviews.llvm.org/D70912 Files: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp clang/test/Analys

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware accepted this revision. baloghadamsoftware added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69948/new/ https://reviews.llvm.org/D69948 ___ cfe-commits mailing lis

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman, gribozavr. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, Szelethus, rnkovacs, xazax.hun, whisperity, mgorny. Herald added a project: clang. Finds cases w

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1768880 , @gribozavr2 wrote: > Is this a common problem? There's a lot of silly code we could try to find, > but if people don't actually write it, then we get all downsides of > maintenance without the benef

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1768704 , @Eugene.Zelenko wrote: > What about new operator? May be check should have option for custom > allocators? Do you mean `new[]`. Thus e.g. `const *carr = new C[n] + 10;` instead of `const *carr =

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1769018 , @gribozavr2 wrote: > This check is quite limited. For example, if the addition is done in a > separate statement, this check wouldn't catch the problem. ASan would. That is not a simple and common

[PATCH] D71001: [Clang-Tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

2019-12-04 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71001#1769018 , @gribozavr2 wrote: > ASan can help debug this issue, and more. ASan is too heavyweight for this simple problem. It does not point out the source of the issue as quickly as this simple check which a

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

2019-12-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 232573. 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: clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

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

2019-12-06 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp:81-82 + diag(PtrArith->getBeginLoc(), + "pointer arithmetic is applied to the result

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

2019-12-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: alexfh, aaron.ballman. baloghadamsoftware added a project: clang-tools-extra. Herald added subscribers: mgehre, Szelethus, rnkovacs, xazax.hun, mgorny. Herald added a project: clang. Finds member initializations in the c

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

2019-12-10 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 233087. baloghadamsoftware added a comment. Updated according to some comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/readability/CMakeLists.txt c

[PATCH] D70912: [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions when printing the Program State

2019-12-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit: https://reviews.llvm.org/rG6e9c58946eee CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70912/new/ https://reviews.llvm.org/D70912 ___ cfe-commits

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

2019-12-11 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG855d21a03ae8: [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a… (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D70244?vs=229313&id=233347

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

2019-12-12 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D71199#1777887 , @aaron.ballman wrote: > In D71199#1775083 , @whisperity > wrote: > > > Can you refresh my memory on whether a rule for "if init expr is constant, > > initia

[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. baloghadamsoft

[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 cl

[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 clang/lib/StaticA

[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 cl

[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: clang/lib/StaticAnalyzer/Check

[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(&BR); + if (!PSBR) +return ""; + NoQ wrote:

[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: clang/lib/Static

[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. `getAnalyzerOptions

[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 https://revi

[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] 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 clang/lib/StaticAnalyzer/Che

[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] 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 LA

[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. `Chec

[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 &getCheckerRegistry() { return Registry; } + DiagnosticsEngine &getDiagnostics() { return Diags; } Please mark these get

[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 https://reviews.llvm.org/D75

[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 only

[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 https://reviews.llvm.or

[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 the

[PATCH] D75842: [Analyzer] Bugfix for CheckerRegistry

2020-03-09 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 249187. baloghadamsoftware added a comment. Test added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75842/new/ https://reviews.llvm.org/D75842 Files: clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h clang/unittests/Sta

[PATCH] D75898: [Analyzer][NFC] Change parameter of NoteTag lambdas to PathSensitiveBugReport

2020-03-10 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. Lambd

[PATCH] D75898: [Analyzer][NFC] Change parameter of NoteTag lambdas to PathSensitiveBugReport

2020-03-10 Thread Balogh, Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20a3d64c8883: [Analyzer][NFC] Change parameter of NoteTag lambdas to PathSensitiveBugReport (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D75898?vs=249289&id=249302

[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: clang/lib/StaticAnalyzer/Checkers

[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)); +} Szelethu

[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 clang/lib/StaticAnalyzer

[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 clang/lib/StaticAnalyzer/Ch

[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 op

[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: > balaz

[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 ex

[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 s

[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 contai

[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 op

[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 ana

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-11 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:102 + /// Given a range, should the argument stay inside or outside this range? + enum RangeKind { OutOfRange, WithinRange }; I would move t

[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 cl

[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 is.

[PATCH] D74541: [Analyzer] Use note tags to track iterator increments and decrements

2020-03-12 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/IteratorModeling.cpp:519-520 +const NoteTag *IteratorModeling::getChangeTag(CheckerContext &C, StringRef Text, +

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

2020-03-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 6 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp:91-111 SVal V = C.getSVal(CE->getArg(0)); const auto *Pos = getIteratorPosition(State, V); + SVal Field =

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

2020-03-13 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 250248. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Updated according to the comments of D75677 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75514/new/ https

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

2020-03-16 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:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->ge

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

2020-03-16 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:713 + StringRef Name; + if (const auto *DRE = dyn_cast(ContE->IgnoreParenCasts())) { +Name = DRE->getDecl()->ge

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

2020-03-16 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/DebugContainerModeling.cpp:32 template void analyzerContainerDataField(const CallExpr *CE, CheckerContext &C, Sze

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

2020-03-17 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:726 +<< Text; +return std::string(Out.str()); + }); NoQ wrote: > I suspect

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

2020-03-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D74615#1923710 , @NoQ wrote: > In D74615#1917289 , @Szelethus wrote: > > > You may have explained it in the summary, and I didn't get it, but why > > isn't putting a `NoteTag`

[PATCH] D74541: [Analyzer] Use note tags to track iterator increments and decrements

2020-03-17 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Herald added a subscriber: DenisDvlp. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:489-490 +StringRef ChangeText = + ((Op == OO_Plus || Op == OO_PlusEqual

<    3   4   5   6   7   8   9   10   >