[PATCH] D110913: [analyzer][solver] Handle simplification to ConcreteInt

2021-10-01 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, ASDenysPetrov, manas, NoQ, vsavchenko. Herald added subscribers: gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus.

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-10-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2108 +LLVM_NODISCARD ProgramStateRef +EquivalenceClass::removeMember(ProgramStateRef State, const SymbolRef Old) { + Remove `const ` Comment at:

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @ASDenysPetrov This looks promising! Please address the nits which @steakhal found, than I think it is good to land. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1641 + // FIXME: Take array dimension into account to prevent exceeding its

[PATCH] D110910: [analyzer][solver] Fix CmpOpTable handling bug

2021-10-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @ASDenysPetrov Gentle ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110910/new/ https://reviews.llvm.org/D110910 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D97699: [analyzer] Add InvalidPtrChecker

2021-10-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Gentle ping, I think we can land this, please do so. Let me know if there is an issue with, .e.g missing commit rights, etc... CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97699/new/ https://reviews.llvm.org/D97699

[PATCH] D103605: [analyzer] Introduce a new interface for tracking

2021-06-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103605#2796141 , @vsavchenko wrote: > In D103605#2796111 , @martong wrote: > >> Great initiative! You haven't mention `markInteresting` functions, but I >> think it would be really i

[PATCH] D103231: [clang][AST] Set correct DeclContext in ASTImporter lookup table for ParmVarDecl.

2021-06-03 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103231/new/ https://reviews.llvm.org/D103231 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D103317: [Analyzer][engine][solver] Simplify complex constraints

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103317#2794099 , @ASDenysPetrov wrote: >> ! In D103317#2793797 , @vsavchenko >> wrote: > > > >> I replied to you earlier that assignments are not producing constraints. >> The anal

[PATCH] D103605: [analyzer] Introduce a new interface for tracking

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103605#2798171 , @NoQ wrote: > Ok. Oof. Whoa. That's amazing. > > Let me re-iterate to make sure that my understanding of this patchset is > correct. > > **Chapter 1.** //"A is correlated with B (ρ = 0.56), given C, assuming

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103314#2790868 , @vsavchenko wrote: > Awesome! > I know, I said that we are ready to land, but I think I was too excited about > this change. We probably should have some data on how it performs on > real-life codebases. J

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:122 #define FB(Name, K) MIX_##Name = (1ull << (K##ull - 1ull)) whisperity wrote: > martong wrote: > > FB stands for FunnyBitmask? Could you p

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Perhaps all conversion related logic should go into their own implementation file? Seems like it adds up to roughly 1000 lines. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:1171 +

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp:550-551 + if (isUselessSugar(LType.getTypePtr())) { +LLVM_DEBUG(llvm::dbgs() + << "--- calculateMixability. LHS is useless sugar.\n"); retu

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 350898. martong added a comment. - Simplify the symbol before eq tracking as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103314/new/ https://reviews.llvm.org/D103314 Files: clang/include/clang/Static

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103314#2798968 , @martong wrote: > In D103314#2790868 , @vsavchenko > wrote: > >> Awesome! >> I know, I said that we are ready to land, but I think I was too excited >> about this ch

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus.

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 350905. martong added a comment. - Change comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/ https://reviews.llvm.org/D103967 Files: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. > I have one thought here. If the lack of simplification indeed caused the > crash, we are in trouble with this patch. IMO simplification in just one > place should make it better, but shouldn't produce infeasible states for us.

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/test/Analysis/find-binop-constraints.cpp:155-158 +// Here, e1 is still bound to (reg_$0) - (reg_$1) but we +// should be able to simplify it to (reg_$0) - 2 and thus realize +//

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > OK, we definitely need to know about performance. Couldn't agree more. I am in the middle of a performance measurement that I do with csa-testbench (on memchached,tmux,curl,twin,redis,vim,openssl,sqlite,ffmpeg,postgresql,tinyxml2,libwebm,xerces,bitcoin,protobuf). Hop

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 350966. martong marked an inline comment as done. martong added a comment. - Remove isEqualTo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103314/new/ https://reviews.llvm.org/D103314 Files: clang/include/

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1789 + if (DisequalToOther.contains(*this)) +return nullptr; if (!DisequalToOther.isEmpty()) { vsavchenko wrote:

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-10 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. I have the first measurements results in the attached zip file. The file contains the html file generated by csa-testbench. It's name contains `CTU` but actually it was a regular non-CTU analysis. The most interesting is probably

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-14 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8ddbb442b6e8: [Analyzer][solver] Simplify existing eq classes and constraints when a new… (authored by martong). Changed prior to commit: https://

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > This patch is the first step of a sequence of patches, and not intended to be > commited as a standalone change. Although I planned to commit this in a lock-step when subsequent patches are also accepted, it makes sense to commit now since it's an obvious improvement

[PATCH] D103792: [clang][AST] Set correct DeclContext in ASTImporter lookup table for template params.

2021-06-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:5961-5962 if (Error Err = ImportDeclParts(D, DC, LexicalDC, Name, ToD, Loc)) return std::move(Err); Do you think that the alternative approach that is used with `TypedefNameDecl`

[PATCH] D103792: [clang][AST] Set correct DeclContext in ASTImporter lookup table for template params.

2021-06-15 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Ok, looks good to me! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103792/new/ https://reviews.llvm.org/D103792

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 352464. martong added a comment. - Extend printJson to handle equivalency info Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/ https://reviews.llvm.org/D103967 Files: clang/lib/StaticAnalyzer/Core/

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103967#2809590 , @NoQ wrote: > Yes we should definitely have as much as possible in the state dump. Okay, I've updated likewise and added two test files to check them in State->dump. Repository: rG LLVM Github Monorepo

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103314#2829806 , @uabelho wrote: > Hi, > > I'm seeing a failed assertion with this patch. > Reproduce with > > clang --analyze bbi-57338.c > > Result: > > clang: /repo/uabelho/master-github/llvm/include/llvm/ADT/APSInt.h:1

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103314#2837907 , @uabelho wrote: > Hi, > > Another failed assertion that started appearing with this patch: > > clang --analyze bbi-57589.c > > which results in: > > clang: ../lib/Support/APInt.cpp:284: int llvm::APInt::co

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. mart

[PATCH] D103314: [Analyzer][solver] Simplify existing constraints when a new constraint is added

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103314#2838065 , @martong wrote: > In D103314#2837907 , @uabelho wrote: > >> Hi, >> >> Another failed assertion that started appearing with this patch: >> >> clang --analyze bbi-5758

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2314-2315 + if (SymbolRef SimplifiedSym = simplify(St, Sym)) +Sym = SimplifiedSym; + vsavchenko wrote: > I don't like the idea of duplicating it into every

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > I don't really get why we get not simplified symbol to begin with. This is because of the Environment bindings. I.e.` b1` is bound to `$a0 - $b0 + $c` when we evaluate `int b1 = (unsigned)a1 + c;`. This binding is not changed/updated, so when we evaluate the division

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 354274. martong added a comment. - Use simplify from RangedConstraintManager Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104844/new/ https://reviews.llvm.org/D104844 Files: clang/include/clang/StaticAnaly

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-24 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2314-2315 + if (SymbolRef SimplifiedSym = simplify(St, Sym)) +Sym = SimplifiedSym; + vsavchenko wrote: > martong w

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-07-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/copy-elision.cpp:9-10 +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -std=c++17 \ +// RUN:-analyzer-config elide-constructors=false -DNO_ELIDE_FLAG \ +// RUN:-analyzer-c

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-08-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping. @vsavchenko Could you please take a look? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106823/new/ https://reviews.llvm.org/D106823 ___ cfe-commits mailing list cfe-commit

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added a comment. Thanks for the review! Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2112-2113 + assert(ClsMembers.contains(Old)); + assert(ClsMembers.getHeight() > 1 && + "Class should have at

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-08-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 364373. martong marked 4 inline comments as done. martong edited the summary of this revision. martong added a comment. - Remove superfluous clang_analyzer_printState - Assert on isEmpty instead of using getHeight Repository: rG LLVM Github Monorepo CHANG

[PATCH] D107078: [analyzer] Catch leaking stack addresses via stack variables

2021-08-17 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. It looks good to me, my concerns are addressed. But please wait for @NoQ 's approval. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107078/new/ https://reviews.llvm.org/D107078 __

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-25 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. Valeriy, thanks for the assiduous and quick review! Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1981 for (const SymbolRef &MemberSym : ClassMembers) { -SymbolRef SimplifiedMemberS

[PATCH] D104844: [Analyzer][solver] Fix crashes during symbol simplification

2021-06-25 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG0646e3625499: [Analyzer][solver] Fix crashes during symbol simplification (authored by martong). Changed prior to commit: https://reviews.llvm.org/D104844?vs=35

[PATCH] D75041: [clang-tidy] Extend 'bugprone-easily-swappable-parameters' with mixability because of implicit conversions

2021-06-25 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Looks acceptable to me as well. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75041/new/ https://reviews.llvm.org/D75041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D104917: [Analyzer] Extend exploded-graph-rewriter to support eq and diseq classes

2021-06-25 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, vsavchenko, NoQ. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this re

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103967#2822287 , @steakhal wrote: > I suspect that the exploded-graph-rewriter should be updated as well so that > the HTML dumps also carry this information. I've put that into a separate patch because that change has its o

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-28 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6f3b775c3e9c: [Analyzer][solver] Add dump methods for (dis)equality classes. (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/

[PATCH] D105005: [analyzer][solver][NFC] Simplify function signatures

2021-06-28 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105005/new/ https://reviews.llvm.org/D105005

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-06-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the report @thakis ! This seems to be b/c of the different newline handling in windows. I've committed a change that disables the tests on windows. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/ https

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-06-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. +1 for note tags. Comment at: clang/test/Analysis/stream-note.c:134 + +void check_eof_notes_3() { + FILE *F; Perhaps we could have some more explanatory test case names. I mean how _3 is different than _2? What is the case each of the

[PATCH] D102492: [clang][AST] Add support for BindingDecl to ASTImporter.

2021-07-01 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102492/new/ https://reviews.llvm.org/D102492

[PATCH] D102492: [clang][AST] Add support for BindingDecl to ASTImporter.

2021-07-02 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. In D102492#2854811 , @balazske wrote: > Not using `auto` declarations. Still looks good, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10249

[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.

2021-07-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:429-435 +const ExplodedNode *N = BR.getErrorNode(); +while (N && N != NotePosition) { + const StreamState *StreamS = N->getState()->get(StreamSym); + if (!StreamS || !

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong reopened this revision. martong added a comment. This revision is now accepted and ready to land. I have changed the dump methods to order the equivalence classes and the disequality info available before printing them out. The ordering is done based on their string representation. This

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 356502. martong added a comment. Herald added a subscriber: mgrang. - Change the dump methods to order the equivalence classes and the disequality info available before printing them out Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION htt

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2583 + + llvm::SmallSet MembersStr; + for (std::pair ClassToSymbolSet : Members) Ah, `SmallSet` is not sorted :( I am gonna have to change this to either `std::

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 356504. martong added a comment. - Use std::set for ordering Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/ https://reviews.llvm.org/D103967 Files: clang/lib/StaticAnalyzer/Core/RangeConstraintMan

[PATCH] D105354: [clang][AST] Add support for DecompositionDecl to ASTImporter.

2021-07-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:2305-2309 + BindingDecl *ToD; + if (GetImportedOrCreateDecl(ToD, D, Importer.getToContext(), DC, Loc, + Name.getAsIdentifierInfo())) +return ToD; + So, we

[PATCH] D105436: [analyzer][solver] Use all sources of constraints

2021-07-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:908 +// into subexpressions of Sym. +Visit(Sym)); } Alright. So, this is correct because `Visit` boils down finally to either `infer(Sym->getTy

[PATCH] D105436: [analyzer][solver] Use all sources of constraints

2021-07-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:908 +// into subexpressions of Sym. +Visit(Sym)); } vsavchenko wrote: > martong wrote: > > Alright. So, this is correct because `Visit` boils do

[PATCH] D104917: [Analyzer] Extend exploded-graph-rewriter to support eq and diseq classes

2021-07-06 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 356751. martong added a comment. Herald added a reviewer: Szelethus. - Rebase on top of the newest version of the dependent patch - Draw borders for the table of the disequality info - Add tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D104917: [Analyzer] Extend exploded-graph-rewriter to support eq and diseq classes

2021-07-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D104917#2845181 , @NoQ wrote: >> We have a few in `test/Analysis/exploded-graph-rewriter/` where we test >> parts of the emitted html. > > And they're now failing on the pre-merge buildbots. So i guess updating > existing tes

[PATCH] D104917: [Analyzer] Extend exploded-graph-rewriter to support eq and diseq classes

2021-07-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > Do you happen to have a screenshot of how it looks? Yes! :) F17793264: image.png F17793282: image.png I've added borders to the tables in the `Disequality Info` section, because the default ren

[PATCH] D105692: [analyzer][solver][NFC] Introduce ConstraintAssignor

2021-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Generally it looks okay to me. However, I have a question: In `SimpleSValBuilder::evalBinOpNN` we do infer values to symbols. E.g. if we have an expression `y / x` and `y` is known to be `0`

[PATCH] D105693: [analyzer][solver][NFC] Refactor how we detect (dis)equalities

2021-07-09 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:687 /// A small helper structure representing symbolic equality. /// This is

[PATCH] D105692: [analyzer][solver][NFC] Introduce ConstraintAssignor

2021-07-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Uhh, what the hell happened with the `Stack`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105692/new/ https://reviews.llvm.org/D105692 ___ cfe-commits mailing list cfe-commits@

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D103967#2864229 , @steakhal wrote: > AFAICT this patch does not introduce significant overhead to the exploded > graph DOT dumps. > Before the patch, an exploded graph took 12G and about 55 secs for a single > top-level funct

[PATCH] D103967: [Analyzer][solver] Add dump methods for (dis)equality classes.

2021-07-14 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbdf31471c76b: [Analyzer][solver] Add dump methods for (dis)equality classes. (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103967/new/

[PATCH] D104917: [Analyzer] Extend exploded-graph-rewriter to support eq and diseq classes

2021-07-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D104917#2860923 , @NoQ wrote: > WDYT about the following format: > > Equality constraints: > reg_$0 == reg_$1 > == reg_$2 > > Disequality constraints: > reg_$0 != reg_$3, > != reg_$4 > > Comma

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-26 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1623 if (!Constraint.containsZero()) { - State = RCM.assumeSymNE(State, LHS, Zero, Zero); + State = RCM.assumeSymRel(State,

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 382362. martong added a comment. - Handle adjustment in `assumeSym` for non-comparison ops. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112296/new/ https://reviews.llvm.org/D112296 Files: clang/include/cl

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 382367. martong added a comment. - Remove superflous change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112296/new/ https://reviews.llvm.org/D112296 Files: clang/lib/StaticAnalyzer/Core/RangeConstraintMan

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp:44-49 +// Handle adjustment with non-comparison ops. +const llvm::APSInt &Zero = getBasicVals().getValue(0, SIE->getType()); +

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 382581. martong marked 3 inline comments as done. martong added a comment. - Add new test case - Adapt style changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112296/new/ https://reviews.llvm.org/D112296 F

[PATCH] D111654: [analyzer] Retrieve a value from list initialization of multi-dimensional array declaration.

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1706-1743 + // Check offsets for being out of bounds. // C++20 [expr.add] 7.6.6.4 (excerpt): // If P points to an array element i of an array object x with n // elements, where

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1757-1760 + // FIXME: Nevertheless, we can't do the same for cases, like: + // const char *str = "123"; // literal length is 4 + // char c = str[41];// offset is 41 + // It sh

[PATCH] D111642: [Analyzer][solver] Simplification: reorganize equalities with adjustment

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG888af47095d5: [Analyzer][solver] Simplification: reorganize equalities with adjustment (authored by martong). Changed prior to commit: https://rev

[PATCH] D111642: [Analyzer][solver] Simplification: reorganize equalities with adjustment

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. Thanks for the assiduous review guys! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111642/new/ https://reviews.llvm.org/D111642 ___ cfe

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. @ASDenysPetrov @steakhal Thanks for the assiduous reviews! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112296/new/ https://reviews.llvm.org/D112296 __

[PATCH] D112296: [Analyzer][solver] Handle adjustments in constraint assignor remainder

2021-10-27 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa8297ed99430: [Analyzer][solver] Handle adjustments in constraint assignor remainder (authored by martong). Changed prior to commit: https://revie

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1757-1760 + // FIXME: Nevertheless, we can't do the same for cases, like: + // const char *str = "123"; // literal length is 4 + // char c = str[41];// offset is 41 + // It sh

[PATCH] D110927: [analyzer] Access stored value of a constant array through a pointer to another type

2021-10-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added a subscriber: vabridgers. martong added a comment. Adding @vabridgers as a subscriber, he might be interested in this. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1675 + // belong to an array with one element of type T. + // Hence, the f

[PATCH] D112642: [clang][NFC] Inclusive terms: Replace uses of whitelist in clang/lib/StaticAnalyzer

2021-10-29 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. Thanks @ZarkoCA, LGTM, but please address the sensible changes advised by Aaron. And thanks @aaron.ballman for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D107339: [analyzer] Retrieve a character from StringLiteral as an initializer for constant arrays.

2021-10-29 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Nice work! Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107339/new/ https://reviews.llvm.org/D107339 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 384117. martong marked 3 inline comments as done. martong added a comment. - Reach the fixpoint by recursively calling `State->assume` on the simplified symbol. - Address review nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1699-1701 + ProgramStateRef OldState; + do { +OldState = State; steakhal wrote: > IMO we should have a `llvm::Statistic` here, tracking the maximum iteration

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 384122. martong added a comment. - Add essay about complexity. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106823/new/ https://reviews.llvm.org/D106823 Files: clang/include/clang/StaticAnalyzer/Core/PathS

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-04 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 384802. martong added a comment. - Add new tests to cover missing line coverage. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106823/new/ https://reviews.llvm.org/D106823 Files: clang/include/clang/StaticA

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > As of diff 5, line 1767 and all the code in the block at line 2184 are > uncovered by the tests you provided. Thanks, I've added new tests that cover the re-assume logic (the block of line 2184). However, I was unable to add a test that covers the case when the sim

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. There are no runtime or peak memory usage growth with this patch (actually, the runtime decreases with a few %). I am attaching the measurements results of the latest Diff.F20089096: stats.html Repository: rG LLVM Github Monorepo

[PATCH] D113261: [analyzer][solver] Remove reference to RangedConstraintManager

2021-11-05 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, ASDenysPetrov, NoQ. Herald added subscribers: manas, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. martong req

[PATCH] D99797: [analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency

2021-11-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks Denys for the update! Very good! However, I think maybe we could make the code a bit more simpler. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:229-233 +// We want to keep the following invariant at all times: +//

[PATCH] D106823: [analyzer][solver] Iterate to a fixpoint during symbol simplification with constants

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG806329da0700: [analyzer][solver] Iterate to a fixpoint during symbol simplification with… (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D113261: [analyzer][solver] Remove reference to RangedConstraintManager

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG01c9700aaad3: [analyzer][solver] Remove reference to RangedConstraintManager (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113261/new/

[PATCH] D103317: [Analyzer][engine][solver] Simplify complex constraints

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 386796. martong marked 7 inline comments as done. martong added a comment. - Rebase on top of parent revisions - Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103317/new/ https://reviews

[PATCH] D103317: [Analyzer][engine][solver] Simplify complex constraints

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:1155-1156 -// TODO: Support SymbolCast. Support IntSymExpr when/if we actually -// start producing them. ASDenysPetrov wrote: > ASDenysPetrov wrote: > > vsa

[PATCH] D113753: [Analyzer][Core] Better simplification in SimpleSValBuilder::evalBinOpNN

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, ASDenysPetrov, NoQ, Szelethus. Herald added subscribers: manas, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this revision. Hera

[PATCH] D113754: [Analyzer][Core] Simplify IntSym in SValBuilder

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, ASDenysPetrov, NoQ, Szelethus. Herald added subscribers: manas, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this revision. Hera

[PATCH] D103317: [Analyzer][Core] Make SValBuilder to better simplify svals with 3 symbols in the tree

2021-11-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 386806. martong edited the summary of this revision. martong added a comment. - Update in comments: `Unknown` -> `Undef` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103317/new/ https://reviews.llvm.org/D10331

<    11   12   13   14   15   16   17   18   19   20   >