[PATCH] D80490: Check for rule of five and zero.

2020-05-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. vrnithinkumar added reviewers: aaron.ballman, alexfh, jbcoe, dblaikie, rsmith. Herald added subscribers: cfe-commits, kbarton, mgorny, nemanjai. Herald added a project: clang. New check to check if a class defines all special members of none of them. This also

[PATCH] D80490: Check for rule of five and zero.

2020-05-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 265921. vrnithinkumar added a comment. fixed the clang-tidy warnig Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80490/new/ https://reviews.llvm.org/D80490 Files: clang-tools-extra/clang-tidy/cppcoregu

[PATCH] D83836: [Analyzer] Add checkRegionChanges for SmartPtrModeling

2020-07-16 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 278622. vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. - Addressing review comments - Enabling commented out tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83836/new/

[PATCH] D83836: [Analyzer] Add checkRegionChanges for SmartPtrModeling

2020-07-16 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 278628. vrnithinkumar marked 8 inline comments as done. vrnithinkumar added a comment. - Adding a missed todo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83836/new/ https://reviews.llvm.org/D83836 File

[PATCH] D83836: [Analyzer] Add checkRegionChanges for SmartPtrModeling

2020-07-16 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:97 +// If a region is removed all of the subregions needs to be removed too. +static ProgramStateRef removeTrackedRegions(Prog

[PATCH] D83877: [Analyzer] Handle unique_ptr::swap() in SmartPtrModeling

2020-07-17 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 278759. vrnithinkumar marked 11 inline comments as done. vrnithinkumar edited the summary of this revision. vrnithinkumar added a comment. - Changes from review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D83877: [Analyzer] Handle unique_ptr::swap() in SmartPtrModeling

2020-07-17 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:198 void SmartPtrModeling::handleSwap(const CallEvent &Call, CheckerContext &C) const { vsavchenko wrote: > I think it wo

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-07-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.ll

[PATCH] D81315: [Draft] [Prototype] warning for default constructed unique pointer dereferences

2020-06-05 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. vrnithinkumar added reviewers: vsavchenko, xazax.hun, NoQ. Herald added subscribers: cfe-commits, martong, Charusso, rnkovacs. Herald added a project: clang. This is just a prototype review for my changes since I thought it will be easier to ask code related d

[PATCH] D81734: Initial smart pointer check

2020-06-12 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar abandoned this revision. vrnithinkumar added a comment. It was a mistake I was supposed to update an existing review. first time use of arc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81734/new/ https://reviews.llvm.org/D81734 _

[PATCH] D81734: Initial smart pointer check

2020-06-12 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, martong. Herald added a project: clang. vrnithinkumar abandoned this revision. vrnithinkumar added a comment. It was a mistake I was supposed to update an existing review. first time use of arc Repository: rG LLVM Git

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-12 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 270391. vrnithinkumar retitled this revision from "[analyzer][Draft] [Prototype] warning for default constructed unique pointer dereferences" to "[analyzer] Warning for default constructed unique pointer dereferences". vrnithinkumar added a comment. Ad

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-12 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 38 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:31 namespace { -class SmartPtrModeling : public Checker { +struct RegionState { +private: vsavchenko wrote: >

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 275076. vrnithinkumar marked 14 inline comments as done. vrnithinkumar added a comment. Herald added a subscriber: mgorny. - Created a new checker for smart point derference diagnostic - Moved checking part to this checker - Kept all the modeling in `Sma

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:574 -def SmartPtrModeling: Checker<"SmartPtr">, +def SmartPtrModeling: Checker<"SmartPtrModeling">, HelpText<"Model behavi

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:577-583 + CheckerOptions<[ +CmdLineOption, + ]>, Szelethus wrote: > NoQ wrote: > > Szelethus wrote: > > > This goes against D81750 -- Sorry for not brin

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 4 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:582 + "false", + InAlpha>, + ]>, Szelethus wrote: > Let's `Hide` this in ad

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 275254. vrnithinkumar added a comment. Addressing review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81315/new/ https://reviews.llvm.org/D81315 Files: clang/docs/analyzer/checkers.rst clang/include/clang/StaticAnalyzer/Checkers

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-03 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 275434. vrnithinkumar marked 11 inline comments as done. vrnithinkumar added a comment. addressing review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81315/new/ https://reviews.llvm.org/D81315 Files: clang/docs/analyzer/checkers.

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-03 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:41 + + bool checkDeferenceOps(const CallEvent &Call, CheckerContext &C) const; +}; NoQ wrote: > Looks like dead code. Thanks! removed. Comme

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-07 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:202-219 +ProgramStateRef +SmartPtrModeling::updateTrackedRegion(const CallEvent &Call, CheckerContext &C, +

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-08 Thread Nithin VR via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20e271a98de5: [analyzer] Warning for default constructed unique_ptr dereference (authored by vrnithinkumar). Changed prior to commit: https://reviews.llvm.org/D81315?vs=275434&id=276327#toc Repository:

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-07-08 Thread Nithin VR via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG20e271a98de5: [analyzer] Warning for default constructed unique_ptr dereference (authored by vrnithinkumar). Changed prio

[PATCH] D83836: Implementing checkRegionChanges

2020-07-14 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, martong. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83836 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp clang/test/Analysis/Inputs/system-header-sim

[PATCH] D83836: [Analyzer] Implementing checkRegionChanges for SmartPtrModeling

2020-07-14 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 3 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:180 +ProgramStateRef SmartPtrModeling::checkRegionChanges( +ProgramStateRef State, const InvalidatedSymbols *Invalidated,

[PATCH] D83877: [Analyzer] Changed in SmartPtrModeling to handle Swap

2020-07-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.ll

[PATCH] D83877: [Analyzer] Changed in SmartPtrModeling to handle Swap

2020-07-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:131 +} \ No newline at end of file I will fix this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D83836: [Analyzer] Implementing checkRegionChanges for SmartPtrModeling

2020-07-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 278207. vrnithinkumar edited the summary of this revision. vrnithinkumar added a comment. Untrack all changing regions in checkRegionChanges Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83836/new/ https:

[PATCH] D83836: [Analyzer] Implementing checkRegionChanges for SmartPtrModeling

2020-07-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:189-190 +// or rvalue references. +// In case of an InstanceCall don't invalidate the this-region since +// it is fu

[PATCH] D82256: Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, martong. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82256 Files: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td clang/include/clang/StaticAnalyzer/Core/Che

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:100 +/// Hints for figuring out of a call should be inlined during evalCall(). +struct EvalCallOptions { + /// Thi

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:586 ExplodedNodeSet dstCallEvaluated; + EvalCallOptions CallOpts; getCheckerManager().runCheckersForEvalCall(dstCallEv

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 272275. vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. Addressing review comment adding miised new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82256/new/ https://rev

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 272276. vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. Fixing wrongly deleted the old commit via arc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82256/new/ https://review

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-24 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 273117. vrnithinkumar added a comment. Fixing test failures Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82256/new/ https://reviews.llvm.org/D82256 Files: clang/include/clang/StaticAnalyzer/Checkers/C

[PATCH] D82256: [analyzer] Enabling ctr in evalCall event

2020-06-24 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 5 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp:130 +llvm::errs() << " (" << ND->getQualifiedNameAsString() << ')'; + llvm::errs() << " {" << Call.getNumArgs()

[PATCH] D82256: [analyzer] Enable constructor support in evalCall event

2020-06-24 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 273162. vrnithinkumar added a comment. clang-format fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82256/new/ https://reviews.llvm.org/D82256 Files: clang/include/clang/StaticAnalyzer/Checkers/Check

[PATCH] D82256: [analyzer] Enable constructor support in evalCall event

2020-06-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added a comment. In D82256#2113233 , @NoQ wrote: > @vrnithinkumar what's your preferred `Full Name ` for llvm's git? Nithin Vadukkumchery Rajendrakumar Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D82256: [analyzer] Enable constructor support in evalCall event

2020-06-25 Thread Nithin VR via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG37c1bf21d1da: [analyzer] Enable constructor support in evalCall event. (authored by vrnithinkumar, committed by Artem Dergachev ). Changed prior to commit: https://reviews.llvm.or

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 273568. vrnithinkumar marked 16 inline comments as done. vrnithinkumar added a comment. Addressing review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81315/new/ https://reviews.llvm.org/D81315 Files: clang/include/clang/StaticAna

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:35 bool isNullAfterMoveMethod(const CallEvent &Call) const; + BugType NullDereferenceBugType{this, "Null-smartPtr-deref", + "C++ smart point

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added a comment. In D81315#2079457 , @Szelethus wrote: > Best of luck on your GSoC! I don't have much else to add to your patch, but > you seem to have made good progress already! Thanks! > In D81315#2078043

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 273841. vrnithinkumar added a comment. Moving dereference precondition checks into `checkPreCall`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81315/new/ https://reviews.llvm.org/D81315 Files: clang/include/clang/StaticAnalyzer/Checkers/

[PATCH] D81315: [analyzer] Warning for default constructed unique pointer dereferences

2020-06-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:117-118 - // TODO: Add a note to bug reports describing this decision. - C.addTransition( - State->BindExpr(Call.getOri

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-07-31 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:408-412 +SmallString<128> Msg; +llvm::raw_svector_ostream Out(Msg); +TagDetails.trackValidExpr(BR); +TagDetails.explainSmartPtrAction(Out); +

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-07-31 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:408-412 +SmallString<128> Msg; +llvm::raw_svector_ostream Out(Msg); +TagDetails.trackValidExpr(BR); +TagDetails.explainSmartPtrAction(Out); +

[PATCH] D83877: [Analyzer] Handle unique_ptr::swap() in SmartPtrModeling

2020-08-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. In D83877#2189637 , @NoQ wrote: > These patches look like they're done, maybe let's land them? I have already committed this changes. https://github.com/llvm/llvm-project/com

[PATCH] D83836: [Analyzer] Add checkRegionChanges for SmartPtrModeling

2020-08-02 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. In D83836#2189636 , @NoQ wrote: > These patches look like they're done, maybe let's land them? This one also committed. (https://github.com/llvm/llvm-project/commit/a560910211

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-03 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 282771. vrnithinkumar marked 10 inline comments as done. vrnithinkumar edited the summary of this revision. vrnithinkumar added a comment. - Addressing review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-03 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:86 + if (const auto *DR = dyn_cast(DerefRegion)) { +auto SmartPtrName = DR->getDecl()->getName(); +OS << " '" << SmartPtrName << "'"; NoQ wrote: > Plea

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-04 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:110 + SmartPtrChecker *Checker = Mgr.registerChecker(); + NullDereferenceBugTypePtr = &Checker->NullDereferenceBugType; } NoQ wrote: > Wait, i don't understa

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-05 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:110 + SmartPtrChecker *Checker = Mgr.registerChecker(); + NullDereferenceBugTypePtr = &Checker->NullDereferenceBugType; } xazax.hun wrote: > NoQ wrote: > > v

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-06 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 283602. vrnithinkumar marked 13 inline comments as done. vrnithinkumar added a comment. - Changes from review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84600/new/ https://reviews.llvm.org/D

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-06 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h:312 + const NoteTag *getNoteTag( + std::function Cb, + bool IsPrunable = false) { xazax.hun wrote: > The callback is taken is an r

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-08 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrChecker.cpp:33 +// Static global pointer to NullDereferenceBugType. +static const BugType *NullDereferenceBugTypePtr; xazax.hun wrote: > I find this comment redundant as

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-08 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 284137. vrnithinkumar marked 4 inline comments as done. vrnithinkumar added a comment. - Review comment changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84600/new/ https://reviews.llvm.org/D84600 Fi

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-08 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added a comment. In D84600#2203604 , @Szelethus wrote: > Layering violations are a running theme in the analyzer -- CheckerRegistry > and the entire MallocChecker fiasco > are two glaring exampl

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-08 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:79 + +// TODO: Enabale this test when "std::swap" is modeled seperately. +void derefOnStdSwappedNullPtr() { vrnithinkumar wrote: > NoQ wrote: > > Instead of commenting

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-09 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/test/Analysis/smart-ptr-text-output.cpp:79 + +// TODO: Enabale this test when "std::swap" is modeled seperately. +void derefOnStdSwappedNullPtr() { NoQ wrote: > vrnithinkumar wrote: > > vrnithinkumar wrote: >

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-09 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 284237. vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. - Updating test with tags from header file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84600/new/ https://reviews.l

[PATCH] D84600: [Analyzer] Support note tags for smart ptr checker

2020-08-11 Thread Nithin VR 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 rG06d100a69a08: [Analyzer] Support note tags for smart ptr checker (authored by vrnithinkumar). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-11 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, martong. Herald added a project: clang. vrnithinkumar requested review of this revision. Fixing tests Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D85796 Files: clang/include/clang/StaticAnalyzer/Co

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-12 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:619 getCheckerManager().runCheckersForEvalCall(DstEvaluated, *I, *Call, *this, - CallOpts); +

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-13 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 285514. vrnithinkumar added a comment. - Addressing review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85796/new/ https://reviews.llvm.org/D85796 Files: clang/include/clang/StaticAnalyzer/Co

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-13 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 5 inline comments as done. vrnithinkumar added a comment. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:619 getCheckerManager().runCheckersForEvalCall(DstEvaluated, *I, *Call, *this, - C

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-14 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 285763. vrnithinkumar marked 3 inline comments as done. vrnithinkumar added a comment. - Fix without passing the NodeBuilder Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85796/new/ https://reviews.llvm.o

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-14 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:682 anyEvaluated = true; +Dst.clear(); Dst.insert(checkDst); > runCheckersForEvalCall() already has its own builder, you don't need another

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this revision.

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147 -if (!move::isMovedFrom(State, ThisR)) { - // TODO: Model this case as well. At least, avoid invalidation of - // globals. - return false; +if (Mod

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:411 + if (NotNullState) { +auto NonNullVal = C.getSValBuilder().makeTruthVal(true); +NotNullState = Since the inner pointer value can be a

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:400 + ProgramStateRef NotNullState, NullState; + std::tie(NotNullState, NullState) = State->assume(CallExprVal.getValue()); + NoQ wrote: > It's alwa

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-15 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this revision.

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-17 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 285969. vrnithinkumar added a comment. - Make exactly single NodeBuilder exists at any given time Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85796/new/ https://reviews.llvm.org/D85796 Files: clang/l

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-17 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerManager.cpp:682 anyEvaluated = true; +Dst.clear(); Dst.insert(checkDst); NoQ wrote: > vrnithinkumar wro

[PATCH] D85796: [Analysis] Bug fix for exploded graph branching in evalCall for constructor

2020-08-18 Thread Nithin VR 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 rGb34b1e38381f: [Analysis] Bug fix for exploded graph branching in evalCall for constructor (authored by vrnithinkumar). Repository: rG LLVM Github

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-19 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:147 -if (!move::isMovedFrom(State, ThisR)) { - // TODO: Model this case as well. At least, avoid invalidation of - // globals. - return false; +if (Mod

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-19 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 286632. vrnithinkumar marked 5 inline comments as done. vrnithinkumar added a comment. Changes to use conjureSymbolVal if the inner pointer value is missing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-19 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:130 +// Returns empty type if not found valid inner pointer type. +static QualType getInnerPointerType(const CallEvent &Call, CheckerContext &C) { + QualType InnerType{};

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-19 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 286675. vrnithinkumar edited the summary of this revision. vrnithinkumar added a comment. - Using conjureSymbolVal in case of missing inner pointer value Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86029

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-19 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:362-363 + const auto *InnerPointVal = State->get(ThisRegion); + if (!InnerPointVal) +return; + xazax.hun

[PATCH] D86293: [analyzer] Add modeling of Eq operator in smart ptr

2020-08-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this revision.

[PATCH] D86293: [analyzer] Add modeling of Eq operator in smart ptr

2020-08-20 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 286868. vrnithinkumar added a comment. - Add assignment to nullptr case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86293/new/ https://reviews.llvm.org/D86293 Files: clang/lib/StaticAnalyzer/Checkers

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-21 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar created this revision. Herald added subscribers: cfe-commits, steakhal, ASDenysPetrov, martong, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: clang. vrnithinkumar requested review of this revision.

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-21 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:295 + P->foo(); // No warning. +} I was trying to test the below code. ``` void foo_() { std::unique_ptr PToMove; std::unique_ptr&& AfterRValeRefCast = std::move(functionRet

[PATCH] D86029: [analyzer] Add modeling for unque_ptr::get()

2020-08-23 Thread Nithin VR via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG55208f5a2126: [analyzer] Add modeling for unque_ptr::get() (authored by vrnithinkumar). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86029/new/ https://rev

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-24 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 287512. vrnithinkumar marked 11 inline comments as done. vrnithinkumar added a comment. - Adding checkLiveSymbols and review comments changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86027/new/ https

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-24 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:137 + const auto *RecordDecl = MethodDecl->getParent(); + if (!RecordDecl || !RecordDecl->getDeclContext()->isStdNamespace()) +return InnerType; xazax.hu

[PATCH] D86293: [analyzer] Add modeling of Eq operator in smart ptr

2020-08-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:351 +bool SmartPtrModeling::handleEqOp(const CallEvent &Call, + CheckerContext &C) const { vsavchenko wrote: > xazax.hun wro

[PATCH] D86293: [analyzer] Add modeling of Eq operator in smart ptr

2020-08-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 287612. vrnithinkumar marked 9 inline comments as done. vrnithinkumar edited the summary of this revision. vrnithinkumar added a comment. - Addressing review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 287641. vrnithinkumar added a comment. - Making the note tags prunable Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86027/new/ https://reviews.llvm.org/D86027 Files: clang/lib/StaticAnalyzer/Checkers/

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-25 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:494-496 + OS << "Smart pointer"; + checkAndPrettyPrintRegion(OS, ThisRegion); + OS << " is non-null"; ---

[PATCH] D86293: [analyzer] Add modeling of Eq operator in smart ptr

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG20676cab1168: [analyzer] Add modeling of assignment operator in smart ptr (authored by vrnithinkumar). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86293/ne

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 288048. vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. - Removing unnecessary notetags. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86027/new/ https://reviews.llvm.org/D8

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked 2 inline comments as done. vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:483 +llvm::raw_ostream &OS) { + BR.markInteresting(T

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 288101. vrnithinkumar added a comment. - Refactoring to reuse common duplicated code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86373/new/ https://reviews.llvm.org/D86373 Files: clang/lib/StaticAnal

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:456 if (BR.isInteresting(ThisRegion) && IsArgValNull) { -OS << "Null pointer value move-assigned to "; +OS << "A null pointer value is moved

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added inline comments. Comment at: clang/test/Analysis/smart-ptr.cpp:295 + P->foo(); // No warning. +} NoQ wrote: > vrnithinkumar wrote: > > I was trying to test the below code. > > ``` > > void foo_

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-26 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar marked an inline comment as done. vrnithinkumar added a comment. In D86373#2231605 , @NoQ wrote: > This is easier than D86293 because there's > no old value in the freshly constructed smart pointer, right? I

[PATCH] D86373: [analyzer] Add modeling for unique_ptr move constructor

2020-08-31 Thread Nithin VR via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1b743a9efa08: [analyzer] Add modeling for unique_ptr move constructor (authored by vrnithinkumar). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86373/new/

[PATCH] D86027: [analyzer] Add bool operator modeling for unque_ptr

2020-08-31 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 288972. vrnithinkumar added a comment. - Addressing review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86027/new/ https://reviews.llvm.org/D86027 Files: clang/lib/StaticAnalyzer/Checkers/Sma

  1   2   >