[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-05-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added inline comments. Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:265-276 + const llvm::APSInt &from = i->From(), &to = i->To(); + const llvm::APSInt &newFrom = (to.isMinSignedValue() ? + BV.getM

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

2018-05-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 144999. baloghadamsoftware added a comment. Rebased. https://reviews.llvm.org/D32905 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/system-header-simulator-cxx.h test/Analysis/iterator-range.cpp Index: test/Ana

[PATCH] D32906: [Analyzer] Iterator Checker - Part 10: Support for iterators passed as parameter

2018-05-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145008. baloghadamsoftware added a comment. Rebased, and minor modifications done according to the comments. https://reviews.llvm.org/D32906 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/iterator-range.cpp test/Analys

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145155. baloghadamsoftware added a comment. Retrying... https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp clang-tidy/bugprone/

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D33537#1086571, @alexfh wrote: > It looks like you've missed some comments or uploaded a wrong patch. The latter. Now I retried to upload the correct patch. https://reviews.llvm.org/D33537 _

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145172. baloghadamsoftware added a comment. Typo fixed. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp clang-tidy/bugprone/

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: docs/clang-tidy/checks/bugprone-exception-escape.rst:8-9 +* Destructors +* Copy constructors +* Copy assignment operators +* The ``main()`` functions dberri

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145174. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. New test added. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145187. baloghadamsoftware added a comment. Fixed according to the comments. https://reviews.llvm.org/D35110 Files: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp test/Analysis/constraint_manager_negate_difference.c test/Analysis/ptr-ar

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-05-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. I chose option 1 for now. https://reviews.llvm.org/D35110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 145452. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D33537 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt clang-tidy/bugprone/ExceptionEscapeCheck.cpp

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-05-07 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 10 inline comments as done. baloghadamsoftware added inline comments. Comment at: test/clang-tidy/bugprone-exception-escape.cpp:178 +void indirect_implicit() noexcept { + // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'indirect_implicit' throws +

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-06-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 152752. baloghadamsoftware added a comment. Comment fixed, assertions inserted, new tests added. https://reviews.llvm.org/D35110 Files: include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h lib/StaticAnalyzer/Core/RangeCon

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2018-06-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153023. baloghadamsoftware added a comment. Herald added a reviewer: george.karpenkov. Herald added a subscriber: mikhail.ramalho. Updated to work with the latest Constrain Manager patch. https://reviews.llvm.org/D32642 Files: lib/StaticAnalyze

[PATCH] D35110: [Analyzer] Constraint Manager Negates Difference

2018-06-28 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC335814: [Analyzer] Constraint Manager Negates Difference (authored by baloghadamsoftware, committed by ). Repository: rC Clang https://reviews.llvm.org/D35110 Files: include/clang/StaticAnalyzer/Cor

[PATCH] D32642: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead-of-begin checks

2018-06-28 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335835: [Analyzer] Iterator Checker - Part 2: Increment, decrement operators and ahead… (authored by baloghadamsoftware, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-06-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153308. baloghadamsoftware added a comment. Herald added a reviewer: george.karpenkov. Herald added a subscriber: mikhail.ramalho. Rebased to https://reviews.llvm.org/rL335835. https://reviews.llvm.org/D32747 Files: include/clang/StaticAnalyzer

[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

2018-06-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153314. baloghadamsoftware added a comment. Herald added a reviewer: george.karpenkov. Herald added a subscriber: mikhail.ramalho. Rebased to https://reviews.llvm.org/rL335835. https://reviews.llvm.org/D32845 Files: include/clang/StaticAnalyzer

[PATCH] D48764: [Analyzer] Hotfix for iterator checkers: Mark left-hand side of `SymIntExpr` objects as live in the program state maps.

2018-06-29 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, mikhail.ramalho. Herald added subscribers: a.sidorin, dkrupp, rnkovacs, szepet, xazax.hun, whisperity. Herald added a reviewer: george.karpenkov. Marking a symbolic expression as live is not recursive. In our check

[PATCH] D32845: [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

2018-06-29 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153481. baloghadamsoftware added a comment. Previous rebase was wrong, this is the correct one. https://reviews.llvm.org/D32845 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/An

[PATCH] D32859: [Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

2018-06-29 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153482. baloghadamsoftware added a comment. Herald added a subscriber: mikhail.ramalho. Rebased to https://reviews.llvm.org/rL335835. https://reviews.llvm.org/D32859 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/mismatc

[PATCH] D48764: [Analyzer] Hotfix for iterator checkers: Mark left-hand side of `SymIntExpr` objects as live in the program state maps.

2018-07-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153698. baloghadamsoftware added a comment. Updated according to the comments and assertions added to fail the tests without the fix. https://reviews.llvm.org/D48764 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp Index: lib/StaticAna

[PATCH] D48427: [Analyzer] Fix for D47417 to make the tests pass

2018-07-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Hmm, then the only solution that comes to my mind is to link iterator positions to container data instead of the container regions. I also have to store a link to the class definition of the container in the container data for the invalidation rules. Containe

[PATCH] D48427: [Analyzer] Fix for D47417 to make the tests pass

2018-07-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 153907. baloghadamsoftware added a comment. Instead of marking the container alive, now we defer deletion of the container data until all its iterators are cleaned up. https://reviews.llvm.org/D48427 Files: lib/StaticAnalyzer/Checkers/Iterator

[PATCH] D48427: [Analyzer] Fix for D47417 to make the tests pass

2018-07-04 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 154066. baloghadamsoftware added a comment. Adding of transition removed since it is part of https://reviews.llvm.org/D47417. https://reviews.llvm.org/D48427 Files: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp Index: lib/StaticAnalyzer/Ch

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-07-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 154357. baloghadamsoftware added a comment. Updated according to the comments. https://reviews.llvm.org/D32747 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorChecker.cpp test/Analysis/Inputs/sys

[PATCH] D48831: alpha.unix.cstring.OutOfBounds checker enable/disable fix

2018-07-05 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. LGTM! But wait for Artem's acceptance before submitting. Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:311 +if (!Filter.CheckCStringO

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-07-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 154358. baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. Re-upload because of a mistake. https://reviews.llvm.org/D32747 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Check

[PATCH] D32747: [Analyzer] Iterator Checker - Part 3: Invalidation check, first for (copy) assignments

2018-07-05 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as not done. baloghadamsoftware added inline comments. Comment at: test/Analysis/invalidated-iterator.cpp:32 + *i0; // expected-warning{{Invalidated iterator accessed}} +} whisperity wrote: > This might not be applicab

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

2018-07-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added reviewers: NoQ, dcoughlin. Herald added subscribers: mikhail.ramalho, a.sidorin, szepet. Herald added a reviewer: george.karpenkov. Currently, the default (range-based) constrain manager supports symbolic expressions of the format

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

2018-07-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. All existing tests pass. I could not find the appropriate test file so I created a new one, but this is probably not the correct way. https://reviews.llvm.org/D49074 ___ cfe-commits mailing list cfe-commits@lists

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

2018-07-09 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. This seems to solve https://bugs.llvm.org/show_bug.cgi?id=32911. https://reviews.llvm.org/D49074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-07-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D49074#1156110, @george.karpenkov wrote: > @baloghadamsoftware @dkrupp @xazax.hun Interesting. What do you think about > instead using Z3 cross-check functionality recently added, to solve this and > all other similar problems inst

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

2018-07-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D49074#1156609, @george.karpenkov wrote: > The overall point is that writing this kind of code is *extremely* > error-prone. Every modifications on the core is extremely error-prone. That is why we must cross check it and only ap

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-07-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Any news regarding this? https://reviews.llvm.org/D33537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2018-07-11 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D49074#1156110, @george.karpenkov wrote: > @baloghadamsoftware @dkrupp @xazax.hun Interesting. What do you think about > instead using Z3 cross-check functionality recently added, to solve this and > all other similar problems inst

[PATCH] D33537: [clang-tidy] Exception Escape Checker

2018-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336997: [clang-tidy] Exception Escape Checker (authored by baloghadamsoftware, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D33537?vs=151876

[PATCH] D48831: alpha.unix.cstring.OutOfBounds checker enable/disable fix

2018-07-13 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337000: [Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fix (authored by baloghadamsoftware, committed by ). Repository: rC Clang https://reviews.llvm.org/D48831 Files: lib/StaticAn

[PATCH] D48764: [Analyzer] Hotfix for iterator checkers: Mark left-hand side of `SymIntExpr` objects as live in the program state maps.

2018-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337151: [Analyzer] Mark `SymbolData` parts of iterator position as live in program… (authored by baloghadamsoftware, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: htt

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

2018-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D49074#1160793, @NoQ wrote: > I'd also rather stick to integer arithmetic and avoid using floats even in > intermediate calculations. It'd be hard to make sure that no rounding errors > kick in if we use floats. Yes, I agree. I t

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-07-18 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D41938#1167313, @NoQ wrote: > There are still performance regressions coming in, and this time it doesn't > look like it's my fault: https://bugs.llvm.org/show_bug.cgi?id=38208 > > I suspect that this might be because we aren't enfo

[PATCH] D49536: [Analyzer] Quick Fix for exponential execution time when simpilifying complex additive expressions

2018-07-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: NoQ. Herald added subscribers: mikhail.ramalho, a.sidorin, dkrupp, rnkovacs, szepet, xazax.hun, whisperity. Herald added a reviewer: george.karpenkov. Patch [[https://reviews.llvm.org/rC329780 | [Analyzer] SValBuilder

[PATCH] D41938: [Analyzer] SValBuilder Comparison Rearrangement (with Restrictions and Analyzer Option)

2018-07-19 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In https://reviews.llvm.org/D41938#1167639, @baloghadamsoftware wrote: > The flag is off by default. Except the rearrangement of additive operations. > Should we put it also behind the flag? I did it as a temporary quick fix: https://reviews.llvm.org/D49536.

[PATCH] D78374: [Analyzer][StreamChecker] Added evaluation of fread and fwrite.

2020-05-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. > Is there a significant gain behind doing that instead of doing a state split > immediately? It feels unnatural to delay the split. It doesn't accurately > represent how the code would run. Are we supposed to do this at every > precall? What about other chec

[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-05-20 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] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-05-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added a comment. I tested this on several open-source projects: BitCoin, CURL, OpenSLL, PostGreS, TMux, Xerces and even on LLVM itself with most of the projects enabled. No new crash and no change in findings. So it seems to

[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-05-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 265219. baloghadamsoftware added a comment. Added unittest for checking the sameness for the regions of same params with different redeclarations. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80286/new/ https://reviews.llvm.org/D80286

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-05-20 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 7 inline comments as done. baloghadamsoftware added a comment. In D79704#2042130 , @martong wrote: > Can we find the FunctionDecl if the call happens through a function pointer? > Or in that case do we actually find the VarDecl o

[PATCH] D57890: [analyzer] Fix in self assignment checker

2020-05-21 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Herald added subscribers: ASDenysPetrov, martong, steakhal. I think you can create a unit test for this: create a pre-call checker that checks for the assignment operator and asserts that we are not in top level. Create a test code with a simple class without

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-21 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] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-21 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/Core/CallEvent.cpp:552 + + Index = StackFrame->getIndex(); + Szelethus wrote: > This mustn't be serious. `StackFrameContext::getIn

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 265928. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. `FIXME` and assertions added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79704/new/ https://reviews.llvm.org/D79704 Files: clang/includ

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. The big question to decide: Either we keep `ParamRegion` as a separate region in the class hierarchy and at the few places where `DeclRegion` or `VarRegion` is used and parameters are possible we duplicate the few lines. (Current status.) The other way is to

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 265926. baloghadamsoftware added a comment. Merged `retrieveFromConstructionContext()` to `handleConstructionContext()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/include/clan

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-25 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/Core/CallEvent.cpp:575 + std::tie(State, RetVal) = + static_cast(&Engine)->handleConstructionContext(getOriginExpr(), +

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

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

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. This is an alternative approach to D79704 . The advantage is that we must not duplicate code everywhere where `VarRegion` (and sometimes also `DeclRegion`) is used. The drawback is that after we implement handling of parameter

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Alternative approach is D80522 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79704/new/ https://reviews.llvm.org/D79704 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

2020-05-25 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266036. baloghadamsoftware added a comment. `SVal` explanation changed to //Xth parameter// format. Unit test changed: there is redeclaration after the definition now, all test code in raw string. CHANGES SINCE LAST ACTION https://reviews.llvm.

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

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 7 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp:126-128 + const auto *Body = dyn_cast_or_null(Ctor->getBody()); + if (!Body) +return;

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

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266117. 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: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.tx

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

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266151. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Fix from `CPlusPlus2a` to `CPlusPlus20` after rebase. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D7119

[PATCH] D80548: [Analyzer][NFC] Remove the SubEngine interface

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

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-26 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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

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

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266277. baloghadamsoftware added a comment. Code reformatted. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71199/new/ https://reviews.llvm.org/D71199 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tools-e

[PATCH] D80548: [Analyzer][NFC] Remove the SubEngine interface

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd70ec366c91b: [Analyzer][NFC] Remove the SubEngine interface (authored by baloghadamsoftware). Changed prior to commit: https://reviews.llvm.org/D80548?vs=266168&id=266281#toc Repository: rG LLVM Git

[PATCH] D80548: [Analyzer][NFC] Remove the SubEngine interface

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. In D80548#2055446 , @MyDeveloperDay wrote: > I think the buildbot might be failing > http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/3664 Fixed now. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266296. baloghadamsoftware added a comment. Herald added subscribers: llvm-commits, MaskRay, hiraditya, arichardson, nemanjai, emaste. Herald added a reviewer: espindola. Herald added a reviewer: MaskRay. Herald added a project: LLVM. Updated accor

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266298. baloghadamsoftware added a comment. Herald added a subscriber: wuzish. Wrong diff uploaded previously, now fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80522/new/ https://reviews.llvm.org/D80522 Files: clang/include/cla

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-26 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added a comment. In D80522#2055040 , @NoQ wrote: > Nice, looks like you managed to reuse most of the code. I still feel like we > should ditch `DeclRegion` entirely (forcing its ~5 cu

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 266851. baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. Updated according to the comments of @balazske. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80522/new/ https://reviews.llvm.org/D80522 Fil

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 5 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:917 assert(isa(sReg) || isa(sReg) || isa(sReg) || isa(sReg)); } balaz

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-28 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. > I will check tomorrow whether we could remove `DeclRegion` without too much > code duplication. It turns out that `DeclRegion` is used in 7 different checkers plus in `BugReporterVisitor`s. One typical us

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-28 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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-28 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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

[PATCH] D79704: [Analyzer] [NFC] Parameter Regions

2020-06-01 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware abandoned this revision. baloghadamsoftware added a comment. Superseded by D80522 . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79704/new/ https://reviews.llvm.org/D79704 ___ cfe-commits

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

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 4 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer-assignment.cpp:29 +public: + Simple2() : n (0) { +x = 0.0; aaro

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

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 267833. 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: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.tx

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-02 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 267879. baloghadamsoftware added a comment. Incorporated @NoQ's solution. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 268082. baloghadamsoftware added a comment. Updated according to the comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80366/new/ https://reviews.llvm.org/D80366 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEv

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 9 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:552 + + Index = StackFrame->getIndex(); + vsavchenko wrote: > Szelethus wrote: > > baloghadamsoftware wrote: >

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 268131. baloghadamsoftware added a comment. Comment fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80522/new/ https://reviews.llvm.org/D80522 Files: clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h clang/include/clan

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions

2020-06-03 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked 2 inline comments as done. baloghadamsoftware added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:921 +public: + const VarDecl *getDecl() const override = 0; + NoQ wrote: > What's the po

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

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

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-03 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/Core/CallEvent.cpp:543 + + const StackFrameContext *StackFrame = Call.getCalleeStackFrame(BlockCount); + if (!StackFrame) NoQ wro

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278394. baloghadamsoftware added a comment. Protection against `Unknown` added for pointer increments and decrements. No more crashes on `LLVM/Clang`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83295/new/ https://reviews.llvm.org/D832

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

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278395. baloghadamsoftware added a comment. Protection agains `Unknown` return values added. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77125/new/ https://reviews.llvm.org/D77125 Files: clang/lib/StaticAnalyzer/Checkers/ContainerMod

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

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

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

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Now I made some measurements about the false positives this option adds. For `BitCoin` the increase was `-1`. I do not know how it happened, but it reduced the number of false positives by one. For `LLVM/Clang` the increase was `15` which is less than `4%` be

[PATCH] D83295: [Analyzer] Hotfix for various crashes in iterator checkers

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa59d4ae4313c: [Analyzer] Hotfix for various crashes in iterator checkers (authored by baloghadamsoftware). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8329

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

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added inline comments. Comment at: clang/test/Analysis/iterator-modelling.cpp:434 + //expected-note@-1 0-1{{Calling 'next}} + //expected-note@-2 0-1{{Passing the value 1 via 2nd parameter 'n'}} + //expecte

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

2020-07-16 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278574. baloghadamsoftware added a comment. Rebased, no tricks with `LazyCompoundVal`s are used anymore. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75677/new/ https://reviews.llvm.org/D75677 Files: clang/lib/StaticAnalyzer/Checkers/

[PATCH] D83190: [analyzer] Model iterator random incrementation symmetrically

2020-07-17 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. Looks good, aside from the few naming issues I mentioned. Please try it on //LLVM/Clang// before committing it to avoid unexpected crashes. Comment a

[PATCH] D76590: [Analyzer] Model `empty()` member function of containers

2020-07-17 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 278832. baloghadamsoftware added a comment. Rebased, updated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76590/new/ https://reviews.llvm.org/D76590 Files: clang/lib/StaticAnalyzer/Checkers/ContainerModeling.cpp clang/lib/StaticAna

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

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/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, ---

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

2020-04-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 254765. baloghadamsoftware added a comment. Lots of things seem to work now. However, I have a question: what to do with the return values of non-inlined calls? It may also be a `LazyCompoundVal`, but non-inlined calls do not have `StackFrameConte

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

2020-04-03 Thread Balogh, Ádám via Phabricator via cfe-commits
baloghadamsoftware added a comment. Output of /home/edmbalo/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/ssd/edmbalo/llvm-project/build/lib/clang/11.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -std=c++11 -analyzer-checker=core,cplusplus

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