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

2021-02-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D95877#2563383 , @davezarzycki wrote: > The test seems to be broken on Fedora 33 (x86-64 with clang-11): > > XPASS: Clang :: Analysis/reinterpret-cast-pointer-to-member.cpp (6531 of > 74360) > TEST 'C

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD created this revision. RedDocMD added reviewers: vsavchenko, NoQ, dcoughlin. Herald added subscribers: steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. RedDocMD requested review of this revision.

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. @vsavchenko, does it look okay? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-21 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. @vsavchenko, could you please review this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-02-22 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD created this revision. RedDocMD added reviewers: NoQ, vsavchenko, dcoughlin. Herald added subscribers: steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. RedDocMD requested review of this revision.

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-02-22 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. @NoQ, @vsavchenko could you please review this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97183/new/ https://reviews.llvm.org/D97183 ___ cfe-commits mailing list cfe-commits

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-02-23 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 325827. RedDocMD added a comment. Making output more gramatically sensible when pretty printing is unavailable Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97183/new/ https://reviews.llvm.org/D97183 Files:

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-02-23 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:466-467 + return; +OS << "Obtained null inner pointer from"; +checkAndPrettyPrintRegion(OS, ThisRegion); + }));

[PATCH] D97183: [analyzer] Add NoteTag for smart-ptr get()

2021-02-23 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 2 inline comments as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:466-467 + return; +OS << "Obtained null inner pointer from"; +checkAndPrettyPrintRegion(OS, ThisRegion); + }));

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-24 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. @steakhal, could you please review this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 2 inline comments as done. RedDocMD added a comment. Many thanks for you comments, @steakhal! I will address the issues you have pointed out in this comment. To clean things up I should perhaps add some more clarification to the summary. > Could you elaborate on what approach did

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 326393. RedDocMD marked 2 inline comments as done. RedDocMD added a comment. Removed explicit for-loop with range-for loop Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D969

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 326410. RedDocMD added a comment. Cleaned up tests, added test above class hierarchy Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 Files: clang/include/clang/Stati

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 326413. RedDocMD added a comment. Added test for multiple inheritance Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 Files: clang/include/clang/StaticAnalyzer/Core/

[PATCH] D96976: [analyzer] Fix reinterpret_cast handling for pointer-to-member

2021-02-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 326414. RedDocMD added a comment. Added some more comments to increase clarity Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96976/new/ https://reviews.llvm.org/D96976 Files: clang/include/clang/StaticAnaly

[PATCH] D98726: [analyzer] Enabling MallocChecker to take up after SmartPtrModelling

2021-06-04 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D98726#2719100 , @RedDocMD wrote: > Judging by this line > > in the `LikelyFalse

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

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

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-05 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 350067. RedDocMD added a comment. Accounting for std::make_unique_for_overwrite Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Che

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-06 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 350103. RedDocMD added a comment. Fixed binding of SVal to variable Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checkers/SmartP

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-06 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. The drawback of the current approach is that we are not using the following piece of information: > std::unique_ptr created from std::make_unique is **not** null (to begin with) I am not being able to use this info since I don't have access to the raw pointer, so cann

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-06 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D103750#2801248 , @xazax.hun wrote: > You can always create a new symbol to represent the inner pointer. Something > like this already happens, when you have a unique_ptr formal parameter and > call get on it. The way `hand

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-06 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 350109. RedDocMD added a comment. Herald added a reviewer: bollu. Reformatted code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-06 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 350110. RedDocMD added a comment. Fixed git history Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 350362. RedDocMD added a comment. Made stylistic refactors Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModelin

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 3 inline comments as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:337 + +bool isUniquePtrType(QualType QT) { + const auto *T = QT.getTypePtr(); NoQ wrote: > Please merge with `isStdSmart

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added a comment. In D103750#2801555 , @NoQ wrote: > Yes I think you should totally do an `evalCall()` here. The function has no > other side effects apart from making a pointer so it's valuable to fully

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D103750#2803499 , @NoQ wrote: > Ugh, this entire `checkBind` hack was so unexpected that I didn't even > recognize `evalCall`. What prevents you from doing everything in `evalCall`? > No state traits, no nothing, just direct

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. Nice. Looks like I have something to read up on. Turns out, I end up learning something new in C++ every now and then. 😃 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 ___

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 351349. RedDocMD added a comment. Put changes discussed in the meeting, tests to come in next revision Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 351356. RedDocMD added a comment. Added tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp clang

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. How do I set the C++ standard while running a test? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 ___ cfe-commits mailing list cfe-c

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 351376. RedDocMD added a comment. Fixed up tests, now also runnning on C++20 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checke

[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:4 // RUN: -analyzer-config cplusplus.SmartPtrModeling:ModelSmartPtrDereference=true\ // RUN: -analyzer-output=text -std=c++11 %s -verify=expec

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 351485. RedDocMD added a comment. Removed un-necessary check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModel

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-11 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 351628. RedDocMD added a comment. Fixed up technique used to find inner pointer type, put TODO's Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/lib/S

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:339 +void makeUniqueForOverwriteReturnsNullUniquePtr() { + auto P = std::make_unique_for_overwrite(); // expected-note {{std::unique_ptr 'P' cons

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 352127. RedDocMD added a comment. Fixed up meaning of make_unique_for_overwrite, use `getConjuredHeapSymbolVal`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 File

[PATCH] D104300: [analyzer] Handle `std::swap`

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

[PATCH] D104300: [analyzer] Handle `std::swap`

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. I am not entirely satisfied with the note that is being emitted currently from the `std::swap` handling (its ripped off from the note emitted for `std::unique_ptr::swap`). Any suggestions? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:217 + if (&BR.getBugType() != smartptr::getNullDereferenceBugType() || + !BR.isInteresting(FirstArgThisRegion)) +return; vsavchenk

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. The current implementation of how notes are emitted in `handleSwap` is broken. Consider the following code: #include void foo() { auto ptr1 = std::unique_ptr(new int(10)); auto ptr2 = std::unique_ptr(new int(13)); ptr1.swap(ptr2); ptr1.reset();

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 352201. RedDocMD added a comment. Refactored common code, removed note emission Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104300/new/ https://reviews.llvm.org/D104300 Files: clang/lib/StaticAnalyzer/Che

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-15 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. I have gotten rid of notes for the time being. The trouble is that, we were not figuring out whether the null-pointer de-reference was occurring due to the null value being swapped with the current pointer. We just //assumed// that. So I am guessing we would need a visi

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-16 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 352621. RedDocMD added a comment. Added more info to the TODO Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/include/clang/StaticAnalyzer/Core/PathSe

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-16 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:3 +// RUN: -analyzer-checker=core,cplusplus.Move,alpha.cplusplus.SmartPtr\ +// RUN: -analyzer-config cplusplus.SmartPtrModeling:ModelSmartPtrDer

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-16 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. I would suppose that constructor calls are properly handled. (ie, member constructors are called properly). As for modelling destructors, there is a separate problem - since we don't have a `Stmt`, the `postCall` handler keeps on crashing. Repository: rG LLVM Github

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-17 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 352627. RedDocMD added a comment. Marking and un-marking interestingness Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104300/new/ https://reviews.llvm.org/D104300 Files: clang/include/clang/StaticAnalyzer/

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked an inline comment as done. RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:3 +// RUN: -analyzer-checker=core,cplusplus.Move,alpha.cplusplus.SmartPtr\ +// RUN: -analyzer-config cplusplus.SmartPtrModeling:ModelSmartPtrDer

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D103750#2825342 , @NoQ wrote: > In D103750#2823741 , @RedDocMD > wrote: > >> I would suppose that constructor calls are properly handled. (ie, member >> constructors are called prope

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 353048. RedDocMD added a comment. Little changes, a failing test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/include/clang/StaticAnalyzer/Core/Pat

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D103750#2825823 , @xazax.hun wrote: > I believe there are a couple of comments that are done but not marked > accordingly. > I agree with Artem, if we could craft code that fails due to not calling > ctors, we should probab

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 5 inline comments as done. RedDocMD added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:435 + void markNotInteresting(SymbolRef sym); + xazax.hun wrote: > Bikeshedding: I wonder if we prefer `Un

[PATCH] D104300: [analyzer] Handle std::swap for std::unique_ptr

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 353068. RedDocMD added a comment. Some more refactoring Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104300/new/ https://reviews.llvm.org/D104300 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/

[PATCH] D103434: [analyzer] Allow visitors to run callbacks on completion

2021-06-18 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD abandoned this revision. RedDocMD added a comment. I am closing this since it has been addressed much better by the patches from @vsavchenko. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103434/new/ https://reviews.llvm.org/D103434

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-06-19 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D103750#2827548 , @RedDocMD wrote: > In D103750#2825342 , @NoQ wrote: > >> Do the above tests pass when your new `evalCall` modeling is enabled? > > The analyzer doesn't seem to be abl

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

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

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. The only method that I think can be realistically modelled is `==` (and thus `!=`). If both the operands refer to the same `unique_ptr`, we know `==` returns true. If they are not the same, the only way `==` can return true if the two smart pointers were initialized fr

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-22 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 353709. RedDocMD added a comment. Logic for handling special cases, when both are unique_ptr Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/Stati

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-22 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D104616#2834770 , @xazax.hun wrote: > In D104616#2834714 , @NoQ wrote: > >> Why not simply delegate this job to `assume(evalBinOp(...))` over raw >> pointer values, which already has

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-24 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D104616#2835061 , @xazax.hun wrote: > In D104616#2835030 , @RedDocMD > wrote: > >> Looks like I have wasted a good deal of effort. :( > > Sorry about that! :( If we learned anything n

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-24 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 354323. RedDocMD added a comment. Removed re-invention, added tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/Checkers/SmartP

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-24 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. We have a failing test here (test at line 473). Which makes me wonder if the `handleComparision` function is at all called. This is something I need to check. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ htt

[PATCH] D106739: [analyzer] Add option to SATest.py for extra checkers

2021-07-30 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. In D106739#2907647 , @ASDenysPetrov wrote: > @RedDocMD Could you, please, explain the motivation and add at least one test > to verify it works. Motivation: I need to run these projects with the SmartPtrChecker enabled (which

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-07-30 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 363138. RedDocMD added a comment. Invalidating using inner pointer destructor call Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-07-30 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. Well some of them are exactly the same type as the `Lame` class example above. Like: `simbody/report-TestArray.cpp-testMoveConstructionAndAssignment-27-1.html#EndPath`. (So the incomplete modelling of the destructor is at least one cause. The other reason that you sug

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-04 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 364074. RedDocMD added a comment. Better modelling, bug fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrMode

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-04 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. I have incorporated the bug-fixes suggested last meeting (except the pointer escape one). And it seems to have had dramatic results - now the only extra errors being reported are the pointer escape ones (5 of them, from 3 different projects). Some projects are actually

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-05 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 364486. RedDocMD added a comment. Bug fix in modelling Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cp

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-05 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 364490. RedDocMD added a comment. Never gonna give you up. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModelin

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-08 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 365031. RedDocMD added a comment. Further pointer escape Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-08 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:440 + State, {std::make_pair(CC->getCXXThisVal(), ArgVal)}, + C.getLocationContext(), PSK_DirectEscapeOnCall, &Call); It seems to me that this p

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-08-16 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 366558. RedDocMD added a comment. Connecting to MallocChecker Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105821/new/ https://reviews.llvm.org/D105821 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrMode

[PATCH] D106739: [analyzer] Add option to SATest.py for extra checkers

2021-08-16 Thread Deep Majumder 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 rG198e6771e24f: [analyzer] Add option to SATest.py for extra checkers (authored by RedDocMD). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 4 inline comments as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:301 + const OverloadedOperatorKind OOK = FD->getOverloadedOperator(); + if (!(OOK == OO_Equal || OOK == OO_ExclaimEqual || OOK == OO_Les

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 354459. RedDocMD added a comment. Refactored code, removed duplications, fixed tests, added some more Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:466 + + clang_analyzer_eval(ptr == ptr); // expected-warning{{TRUE}} + clang_analyzer_eval(ptr > ptr); // expected-warning{{FALSE}} xazax.hun wrote: > Putting tests like this on the

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-25 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 354460. RedDocMD added a comment. Removed dump statement Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr.h clan

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-26 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:466 + + clang_analyzer_eval(ptr == ptr); // expected-warning{{TRUE}} + clang_analyzer_eval(ptr > ptr); // expected-warning{{FALSE}} xazax.hun wrote: > RedDocMD wrote: > > xazax.hun w

[PATCH] D104616: [analyzer][WIP] Model comparision methods of std::unique_ptr

2021-06-26 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 354695. RedDocMD added a comment. First try at implementing conversion function from OverloadedOperatorKind to BinaryOperatorKind Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-06-29 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. Sorry for not updating. Was down with fever. This patch does *not* work now. `operationKindFromOverloadedOperator` is broken because the maps don't get populated. I am not entirely sure why this is happening. Will try to fix tomorrow. @NoQ, @vsavchenko, @xazax.hun, @tee

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-06-29 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 355445. RedDocMD added a comment. Fixed bug in enum conversion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr.h

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-06-30 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 355458. RedDocMD added a comment. Refactored out common block Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr.h

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-06-30 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:443-446 + auto RetVal = C.getSValBuilder().evalBinOp( + State, BOK, FirstPtrVal, SecondPtrVal, Call.getResultType()); + State = State->BindExpr(Call.getOriginExpr(), C.getLoc

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-02 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 356128. RedDocMD added a comment. Performing state split on normal comparision ops Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-02 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 3 inline comments as done. RedDocMD added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:484 + clang_analyzer_eval(nullPtr != nullptr);// expected-warning{{FALSE}} + clang_analyzer_eval(nullptr <= unknownPtr); // expected-warning{{TRUE}} +} -

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-02 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 356226. RedDocMD added a comment. Simplify SVal on state split, other refactors Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/lib/StaticAnalyzer/Che

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-04 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 4 inline comments as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:316 + +class OperatorKind { + union { NoQ wrote: > One good place to put this may be `CheckerHelpers.h`. This is where w

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-04 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 356371. RedDocMD added a comment. Little refactors Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/Che

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-05 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD created this revision. RedDocMD added reviewers: NoQ, vsavchenko, xazax.hun, teemperor. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. RedDocMD requested review of this re

[PATCH] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-05 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 356526. RedDocMD added a comment. Major bug fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/Checke

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 357031. RedDocMD added a comment. Invalidating regions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr.h clang/

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-07 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:218-219 + + if (isStdOstreamOperatorCall(Call)) +return true; + NoQ wrote: > When you're doing `evalCall` you're responsible for modeling *all* aspects of > t

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-08 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 357307. RedDocMD added a comment. Little refactors Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp I

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-08 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. I will be figuring out some tests tomorrow morning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 ___ cfe-commits mailing list cfe-c

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-09 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 357422. RedDocMD added a comment. Tests implemented Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-10 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD marked 4 inline comments as done. RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:195 +const SmallVector BasicOstreamName = {"basic_ostream"}; + vsavchenko wrote: > Same here + don't call it "Name" (si

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-10 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 357724. RedDocMD added a comment. Little refactors, one more test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr

[PATCH] D105821: [analyzer] [WIP] Model destructor for std::unique_ptr

2021-07-12 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD created this revision. RedDocMD added reviewers: NoQ, vsavchenko, xazax.hun, teemperor. Herald added subscribers: manas, steakhal, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. RedDocMD requested review of this re

[PATCH] D105421: [analyzer] Handle << operator for std::unique_ptr

2021-07-13 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 358204. RedDocMD added a comment. Removed stupid mistakes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105421/new/ https://reviews.llvm.org/D105421 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling

[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

2021-07-13 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 358267. RedDocMD added a comment. Fixing up tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103750/new/ https://reviews.llvm.org/D103750 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVal

<    1   2   3   >