[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-04-13 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ Many thanks for your evaluation! > Wait, no, nvm, please disregard this. It wasn't like this forever, i just > happened to catch code in an intermediate state after D90157 > . Either way, it's definitely getting much >

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

2021-04-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Thank you for a proposed solution. It looks much easier to understand and maintain. Great! I will take it into account. > Well, that is a nice exercise for "two pointer" problems, but can we please > talk about the actual use case for it? I'm

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

2021-04-07 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 335768. ASDenysPetrov retitled this revision from "[analyzer] Handle intersections and adjacency in RangeSet::Factory::add function" to "[analyzer] Implemented RangeSet::Factory::unite function to handle intersections and adjacency". ASDenysPetrov

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Many thanks for your feedback! I will make a new separate function for checking intersections considering all your suggestions along with the old quick `add` versions. I'll be more optimized. Comment at:

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal thanks for the approval. Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:564-565 } - - llvm_unreachable("Unknown SVal kind"); } steakhal wrote: > You probably don't want to remove this. The same applies

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko FYI. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:112-113 +RangeSet RangeSet::Factory::add(RangeSet LHS, RangeSet RHS) { + if (LHS.isEmpty()) +return RHS; + for (const Range : RHS) Also

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 335011. ASDenysPetrov added a comment. Updated. Restored complexity to O(N). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/ https://reviews.llvm.org/D99797 Files:

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko OK, what do you think of ***adjacency*** feature? I mean it simplifies such ranges `[1,2][3,4][5,6]` to `[1,6]`. Is it worth for implementation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99797/new/

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D99797#2666358 , @vsavchenko wrote: > Thanks for working on improvements of the solver and constraints! However, I > have some tough questions about this patch. > > What I really want to understand here is motivation.

[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: vsavchenko, steakhal, NoQ, xazax.hun, dcoughlin, Szelethus. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. In D95246#2606343 , @abhina.sreeskantharajan wrote: > This issue has been fixed in https://reviews.llvm.org/D97472. > @ASDenysPetrov I'm

[PATCH] D95808: [test] Use host platform specific error message substitution in lit tests - continued

2021-04-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. In D95808#2657744 , @jhenderson wrote: > @ASDenysPetrov, I think you need to mark this patch as Accepted so that > someone can close

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Just a ping for you, guys, to let me move in this direction. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D98504: [clang][Checkers] Fix PthreadLockChecker state cleanup at dead symbol.

2021-03-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Hi, @balazske Comment at: clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp:290-304 // Existence in DestroyRetVal ensures existence in LockMap. // Existence in Destroyed also ensures that the lock state for lockR is either //

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 329982. ASDenysPetrov added a comment. Updated. In D96090#2618410 , @NoQ wrote: > In all cases we're supposed to have an **original** type, whether we need it > or not. Simply because we're simulating a typed

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

2021-03-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D97388#2615104 , @NoQ wrote: > Ok then, let's try to land it! 爛 Thanks for the approval. Before land this we should land the preparatory revision D97296 . Please, take a look. CHANGES

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-10 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D96090#261 , @steakhal wrote: > You could still pass a default constructed QualType at each callsite. We can try. At least it will be like this is a hack for the particular cases then, that will emphesys to pay

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-10 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 329699. ASDenysPetrov edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 329282. ASDenysPetrov added a comment. Updated due to discussion. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97874/new/ https://reviews.llvm.org/D97874 Files: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-03-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ wrote: > IIUC this is roughly the first time ever when `SValBuilder` starts emitting > symbols of float type. This is a huge change with an almost unlimited scope > of unexpected side effects and very rigorous testing is required to > understand the actual

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ Thanks for your comment. Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:877-879 + std::tie(IsZero, IsNotZero) = + getStateManager().getConstraintManager().isSymValWithinOrOutsideRange( + State, SE,

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ Thanks, I could finally draw your attention :) > When, and why, would a regular user use this functionality? IMO there is no reason to use evalCast without an **original** type. But I'm not sure that you can get an **original** type in every case. About

[PATCH] D97296: [analyzer] Add a new parameter ProgramStateRef to SValBuilder::evalCast function

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328238. ASDenysPetrov added a comment. Missed to add changes in unittests. Fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97296/new/ https://reviews.llvm.org/D97296 Files:

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328109. ASDenysPetrov added a comment. Rebased on main. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97874/new/ https://reviews.llvm.org/D97874 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328108. ASDenysPetrov added a comment. Rebased on main. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97388/new/ https://reviews.llvm.org/D97388 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D97296: [analyzer] Add a new parameter ProgramStateRef to SValBuilder::evalCast function

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328107. ASDenysPetrov added a comment. Rebased on main. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97296/new/ https://reviews.llvm.org/D97296 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h

[PATCH] D97277: [analyzer] Eliminate dispatchCast, evalCastFromNonLoc and evalCastFromLoc functions from SValBuilder

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328106. ASDenysPetrov added a comment. Rebased on main. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97277/new/ https://reviews.llvm.org/D97277 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-03-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 328105. ASDenysPetrov added a comment. Rebased on main. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D97874: [analyzer] Improve SVal cast from integer to bool using known RangeSet

2021-03-03 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: steakhal, NoQ, xazax.hun, vsavchenko, Eugene.Zelenko. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet,

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

2021-02-26 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > Please make sure that you specify the parent revision or the patch can be > applied on top of the tree. Sorry, probably missed to add a parent revision. Done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97388/new/

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

2021-02-26 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 326651. ASDenysPetrov added a comment. A bit improved. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97388/new/ https://reviews.llvm.org/D97388 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson I think I'm done. Here is output: F15648076: linker_trace_output.txt Is it OK now? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95246/new/

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > Sorry, but `-W --trace` is not the same as `-Wl,--trace`. The former is a > pair of options used by the compiler (one of which describes the files used > by the compiler). The latter is an option passed to the linker, and is what > we need. Please

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > Thanks (for clarity, `libz` isn't what I'm looking for, it was just an > example of how this information might be useful). As it is, I think we might > need more information still - that commandline hides which files are actually > used slightly.

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. > This shows, for example, that the `libz.so` my build uses is located in > `/usr/lib/x86_64-linux-gnu`. By having your equivalent path, we can hopefully > confirm that the issue is caused by a different set of system libraries being > used. Hi, @jhenderson I

[PATCH] D97388: [analyzer] Replace StoreManager::evalIntegralCast with SValBuilder::evalCast

2021-02-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: steakhal, xazax.hun, NoQ, vsavchenko. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-24 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @abhina.sreeskantharajan wrote: > @ASDenysPetrov are you running python inside MSYS bash? that is installed by No, I installed Python as usual via Windows msi got from official site. Here is what I've got from Python: >>> sys.platform 'win32' >>>

[PATCH] D97296: [analyzer] Add a new parameter ProgramStateRef to SValBuilder::evalCast function

2021-02-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: steakhal, xazax.hun, Charusso, Szelethus, vsavchenko. ASDenysPetrov added a project: clang. Herald added subscribers: martong, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. ASDenysPetrov

[PATCH] D97277: [analyzer] Eliminate dispatchCast, evalCastFromNonLoc and evalCastFromLoc functions from SValBuilder

2021-02-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: rnk, krememek, vsavchenko, steakhal, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > I would like @NoQ or someone else to also review this. Oh, I would be very pleased if our colleagues pay attention to my recent patches. But seems you are the only who helps me with this stuff  CHANGES SINCE LAST ACTION

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. This is just a note for me to correctly rebase it in the future: https://reviews.llvm.org/D96090?vs=321602=322422#toc CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95799/new/ https://reviews.llvm.org/D95799 ___

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal wrote: > This patch preserves all previous reports as expected. If this patch is technically full-baked and does not bring any harm, can we approve this it as well to move forward? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 324964. ASDenysPetrov edited the summary of this revision. ASDenysPetrov added a comment. Rebased revision on top of the main branch. Minor improvements. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @abhina.sreeskantharajan > Can you share the output of > > sysconfig.get_platform() Sure, >>> sysconfig.get_platform() 'win32' >>> Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95246/new/

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D96090#2568431 , @steakhal wrote: > This patch preserves all previous reports as expected. That's great results! > Could you please rebase this? I'll update and rebase this patch soon. > If it depends on any parent

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2021-02-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > Could you please give a few links to some documentation about the functions > you are trying to model? Yes, you a re right. I've edited the summary with the link. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87146/new/

[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko Hi, I actually want this patch goes developing and be loaded. It's really the worth one. Is it abandoned? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86465/new/ https://reviews.llvm.org/D86465

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson I'm using `cmake -GNinja ../llvm -DLLVM_LIT_ARGS=-sv -DLLVM_ENABLE_PROJECTS=clang -DLLVM_TARGETS_TO_BUILD=X86 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON` for setup and `ninja` for build. Here is my CMakeCache.txt config file. F15567363:

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @jhenderson > @ASDenysPetrov, could you provide your link command-line for one of the tools > that produces the failing message, please, e.g. llvm-ar? Here is output of running tests in llvm-ar folder: F15562458: fail_output_llvm_ar.txt

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D95246#2566417 , @abhina.sreeskantharajan wrote: > I was curious if all of these modified testcases are now failing or only the > three you mentioned. Here is the list of the tests which fail after the patch (I haven't

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D95246#2565351 , @abhina.sreeskantharajan wrote: > > Do you know what is different between your environments which is causing the > spelling to be capitalized? This might help me determine how to fix the > current

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-02-16 Thread Denys Petrov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13f4448ae7db: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way (authored by ASDenysPetrov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. One more mention. There are a lot of popups like this which stops the process untill press OK. F15539777: test_err.png That's very annoying. Please revert or fix this patch. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D95246: [test] Use host platform specific error message substitution in lit tests

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov reopened this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. Herald added a project: lld-macho. Herald added a reviewer: lld-macho. This patch causes fails in a bunch of test files. When I roll it back, it passes. Below you can see fail

[PATCH] D95808: [test] Use host platform specific error message substitution in lit tests - continued

2021-02-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov reopened this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. Hi, @abhina.sreeskantharajan. I've just updated my repo and got this patch. After your changes I caught a test fail specifically in my domain of Clang Static Analyzer. Here is

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > In the upcoming days, I'm gonna schedule this on our CI. We will see the > results. Thank you. That would be great! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/ https://reviews.llvm.org/D96090

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-02-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Hi, guys! Does anyone can review this item, except @steakhal (thanks him)? Please, look. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90157/new/ https://reviews.llvm.org/D90157 ___ cfe-commits mailing list

[PATCH] D86533: (Urgent!) [release][docs][analyzer] Add 11.0.0. release notes

2021-02-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added inline comments. Comment at: clang/docs/ReleaseNotes.rst:453 + equal or known to be non-equal. + +- Added :ref:`on-demand parsing ` capability to Cross Translation Szelethus wrote: > ASDenysPetrov wrote: > > I've added the patch "Reasoning

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 322422. ASDenysPetrov added a comment. Updated. Unlinked parent revision D95799 from the stack. Made corresponding changes in this patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96090/new/

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D96090#2544477 , @steakhal wrote: > Please, consider removing D95799 from the > parent revisions if that is not a hard requirement of this patch. Actually D95799

[PATCH] D95877: [analyzer] Fix static_cast on pointer-to-member handling

2021-02-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I downloaded and tested this patch. On the whole it works OK. See my suggestions below. Comment at: clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp:205 + llvm::SmallPtrSet BaseSpecSeen; + for (const auto : BaseSpecList) { +auto

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2021-02-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 321693. ASDenysPetrov added a comment. Updated. Rolled the fix over the evalCast refactoring. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89055/new/ https://reviews.llvm.org/D89055 Files: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2021-02-05 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ > Ugh, sorry, no, that's `evalCast()`. Like `evalBinOp()` etc. My bad. Can we > also use `evalCast()`? Finally :-) Now we can use `evalCast()` instead of `CastRetrievedVal()`. It would be nice if you could look at D96090 .

[PATCH] D92928: [analyzer] Highlight arrows for currently selected event

2021-02-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Herald added a subscriber: nullptr.cpp. HTML sample looks fine! But there is the same problem as in D92639 . IE doesn't draw arrows. Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:166 +

[PATCH] D96090: [analyzer] Replace StoreManager::CastRetrievedVal with SValBuilder::evalCast

2021-02-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, steakhal, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: nullptr.cpp, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-02-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 321585. ASDenysPetrov added a comment. Updated. Moved comments as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95799/new/ https://reviews.llvm.org/D95799 Files: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-02-04 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Herald added a subscriber: nullptr.cpp. Hi, folk! Please, review this tiny patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95799/new/ https://reviews.llvm.org/D95799

[PATCH] D95799: [analyzer] Symbolicate float values with integral casting

2021-02-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, xazax.hun, baloghadamsoftware, steakhal, vsavchenko. ASDenysPetrov added a project: clang. Herald added subscribers: martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet.

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2021-01-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Just want to load this revision in scope of the stack. I need you review for this. Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87146/new/ https://reviews.llvm.org/D87146 ___ cfe-commits mailing list

[PATCH] D86295: [analyzer] Reorder the layout of MemRegion and cache by hand for optimal size

2021-01-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. What about this change? Did you make more measurements? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86295/new/ https://reviews.llvm.org/D86295 ___ cfe-commits mailing

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-01-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 318991. ASDenysPetrov added a comment. Updated. Naming fixes. Member access changes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90157/new/ https://reviews.llvm.org/D90157 Files:

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-01-25 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > Why don't you use the `SValVisitor` instead? I simply didn't know of its exsistence. We can try to transform this patch using `SValVisitor` in the next revision to make the review easier and avoid additional complexity. Comment

[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

2021-01-20 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. My propositions for the function `negate`. Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:421 + ContainerType Result; + Result.reserve(What.getMinValue() == MIN ? What.size() + 1 : What.size()); Here you

[PATCH] D86465: [analyzer][solver] Redesign constraint ranges data structure

2021-01-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. I didn't check correctness of each Factory function but if it passes all tests and improves performance, I think it's enough. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h:77-78 + // + // *

[PATCH] D92639: [analyzer] Add control flow arrows to the analyzer's HTML reports

2021-01-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @vsavchenko > F14534708: report-6ea17d.html I checked it in IE. It doesn't draw arrows. Investigate this, please. Comment at: clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp:147 +bool isArrowPiece(const

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-01-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 317351. ASDenysPetrov added a comment. @steakhal Oh, sure. Updated. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90157/new/ https://reviews.llvm.org/D90157 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2021-01-18 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 317342. ASDenysPetrov added a comment. Unfortunately I wasn't able to reproduce the singe difference in PostgreSQL project. So I revised the patch in a part of the difference nature. This update passed all of CodeChecker's tests without any difference.

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2020-12-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Thank to @steakhal for the new tests. //All// previous result differences have **gone** in `FFMPEG` and `twin` but a new //one// **appeared** in `PostgreSQL`. /src/common/d2s.c Line 895 Memory copy function overflows the destination buffer

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2020-12-21 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 313114. ASDenysPetrov added a comment. @steakhal I've precisely inspected your reports and find the bug. I've fixed it. I also verified all the rest and find some other vulnerabilities and fixed them as well. Thank you for your testing, and I would

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2020-12-16 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Hey, folk. Please, look at this revision. This is the **2nd** revision from the //stack of 3//. Its aim is preparing the field for the **3rd** revision (also welcome to review). The **1st** one has been closed. CHANGES SINCE LAST ACTION

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2020-12-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal Thank you for your invaluable analysis! > What do you think @ASDenysPetrov ? I think if there is any difference then I have to inspect the changes deeper. I tryed to make this changes in a way of not changing any behaviour. Let me back to this patch a

[PATCH] D85984: [analyzer] Add a new checker alpha.cplusplus.CPlusPlus11Lock

2020-12-11 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. A gentle ping :-) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85984/new/ https://reviews.llvm.org/D85984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D89987: [analyzer] [NFC] Rename SymbolRef to SymExprRef

2020-12-02 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @steakhal > Losing **git blame** would have a signifficant impact in deed, however we > always have the option to add the renaming commit to the > `.git-blame-ignore-revs`. Using this git feature I can see no more obstacles to implement the renaming. Moreover

[PATCH] D85984: [analyzer] Add a new checker alpha.cplusplus.CPlusPlus11Lock

2020-12-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 308781. ASDenysPetrov added a comment. @NoQ , considered your suggestions about the case of recursive mutexes. Implemented this feature. Now this works like below: recursive_mutex rm; rm.lock(); rm.lock(); // no-warning recursive_timed_mutex

[PATCH] D87146: [analyzer] Implement shared semantics checks for XNU functions in PthreadLockChecker

2020-12-01 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Just a ping. Let me, please, do smth with this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87146/new/ https://reviews.llvm.org/D87146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2020-10-29 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. Who can confirm if this is correct or somewhere it needs fixes? Here is a generated result of `evalCast` from the origin branch(before the patch): void foo(int* x, // {reg_$0} int** y, // {reg_$0} int***z) // {reg_$0} { (void*)x;

[PATCH] D89982: [analyzer] [NFC] Simplify SVal::getAsLocSymbol function using existing functions

2020-10-26 Thread Denys Petrov 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 rG32efb81ea60a: [analyzer] [NFC] Simplify SVal::getAsLocSymbol function using existing functions (authored by ASDenysPetrov). Repository: rG LLVM

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-26 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D89055#2336709 , @NoQ wrote: > Ugh, sorry, no, that's `evalCast()`. Like `evalBinOp()` etc. My bad. Can we > also use `evalCast()`? I dived into `evalCast()`. Initially I had to figure it out and rework it to find the

[PATCH] D90157: [analyzer] Rework SValBuilder::evalCast function into maintainable and clear way

2020-10-26 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: NoQ, steakhal, krememek, xazax.hun. ASDenysPetrov added a project: clang. Herald added subscribers: cfe-commits, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware.

[PATCH] D89987: [analyzer] [NFC] Rename SymbolRef to SymExprRef

2020-10-23 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @OikawaKirie > Different from ProgramStateRef which is an alias to IntrusiveRefCntPtr, or > StoreRef which is a wrapper object, an alias to a const SymExpr * makes no > sense to me. Yes. I omit this, because in such case we should go further and rename all

[PATCH] D89982: [analyzer] [NFC] Simplify SVal::getAsLocSymbol function using existing functions

2020-10-22 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov created this revision. ASDenysPetrov added reviewers: krememek, vsavchenko, NoQ, martong, steakhal. ASDenysPetrov added a project: clang. Herald added subscribers: cfe-commits, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware,

[PATCH] D77062: [analyzer] [NFC] Simplify CStringChecke::assumeZero function

2020-10-19 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 299018. ASDenysPetrov retitled this revision from "[analyzer] Improve zero assumption in CStringChecke::assumeZero" to "[analyzer] [NFC] Simplify CStringChecke::assumeZero function". ASDenysPetrov edited the summary of this revision. ASDenysPetrov

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-17 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ > The new code should obviously be restricted into evalCastFromLoc() because if > it's a region it's a Loc. The first I tryed was `evalCastFromLoc()`, but it turned out that `SVal` which binds to a pointer can be `NonLoc` as well through violation of

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-15 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 298388. ASDenysPetrov added a comment. Updated. Moved `castRegion()` to `SValBuilder`. Actually it wasn't so hard as I thought :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89055/new/ https://reviews.llvm.org/D89055 Files:

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-13 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ > Can we collapse this function further towards this goal? Say, why not pump > every region unconditionally through castRegion()? Does dispatchCast() use > castRegion() internally - and if it does, why are there so many branches in > this function? I've

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-13 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 297822. ASDenysPetrov added a comment. Updated. Removed a new test file, moved the test to an existing file instead. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89055/new/ https://reviews.llvm.org/D89055 Files:

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov updated this revision to Diff 297579. ASDenysPetrov added a comment. Updat patch due to suggestions and fixed formating. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89055/new/ https://reviews.llvm.org/D89055 Files: clang/lib/StaticAnalyzer/Core/Store.cpp

[PATCH] D89225: [MinGW][clang-shlib] Build only when LLVM_LINK_LLVM_DYLIB is enabled

2020-10-12 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov accepted this revision. ASDenysPetrov added a comment. This revision is now accepted and ready to land. It works for me. Well done! I've applied your patch and tried this: cmake -GNinja ../llvm -DLLVM_LIT_ARGS=-sv -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_ENABLE_PROJECTS=clang

[PATCH] D87547: [MinGW][clang-shlib] Build by default on MinGW

2020-10-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. In D87547#2322325 , @mati865 wrote: > @ASDenysPetrov what CMake options do you use? > I'm unable to reproduce this error with Clang+LLD and GCC+Binutils from MSYS2. Sorry for not mentioning that. This is my cmd: cmake

[PATCH] D89055: [analyzer] Wrong type cast occures during pointer dereferencing after type punning

2020-10-09 Thread Denys Petrov via Phabricator via cfe-commits
ASDenysPetrov added a comment. @NoQ BTW, what you think we should do with D77062 and D88477 then? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89055/new/

<    1   2   3   4   5   6   7   >