[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

2020-10-09 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. vrnithinkumar marked an inline comment as done. Closed by commit rG0b4fe8086f03: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner…

[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

2020-10-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:106 const auto *InnerPointVal = State->get(ThisRegion); - return InnerPointVal && InnerPointVal->isZeroConstant(); +

[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

2020-10-07 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar updated this revision to Diff 296785. vrnithinkumar added a comment. - Addressing review comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87043/new/ https://reviews.llvm.org/D87043 Files:

[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

2020-09-28 Thread Nithin VR via Phabricator via cfe-commits
vrnithinkumar added a comment. In D87043#2294531 , @Szelethus wrote: > Congrats on your GSoC! Unless I missed it, it seems like you haven't posted > your final report on cfe-dev, even though its an amazing looking document > with a lot of examples and

[PATCH] D87043: [Analyzer] Fix for dereferece of smart pointer after branching on unknown inner pointer

2020-09-02 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

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

2020-08-31 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 rGbc3d4d9ed783: [analyzer] Add bool operator modeling for unque_ptr (authored by vrnithinkumar). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2020-08-31 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:556 +const LocationContext *LC = C.getLocationContext(); +InnerPointerVal = C.getSValBuilder().conjureSymbolVal( +

[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 288974. vrnithinkumar added a comment. - Fixing minor spacing issue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86027/new/ https://reviews.llvm.org/D86027 Files:

[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:

[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] 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?

[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

[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 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:

[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 ) { +

[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/

[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

[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] 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:

[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

[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 , + CheckerContext ) const { vsavchenko wrote: > xazax.hun wrote: >

[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/

[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;

[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/

[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 =

[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

[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:

[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

[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] 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

[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 , CheckerContext ) { + QualType InnerType{};

[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

[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

[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] 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

[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:

[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

[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

[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

[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

[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

[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

[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/

[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, -

[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:

[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-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:

[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

[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/

[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-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

[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

[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

[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/

[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 = >NullDereferenceBugType; } xazax.hun wrote: > NoQ wrote: > >

[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 = >NullDereferenceBugType; } NoQ wrote: > Wait, i don't understand

[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: >

[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

[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.

[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.

[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] 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

[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 , CheckerContext ) const { vsavchenko wrote: > I think it would be

[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

[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

[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

[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] 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

[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/

[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

[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

[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] 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

[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

[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=276327#toc Repository:

[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 , CheckerContext , +

[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 , CheckerContext ) const; +}; NoQ wrote: > Looks like dead code. Thanks! removed. Comment at:

[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:

[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

[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

[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

[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

[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

[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( -

[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:

[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-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:

[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 ) const; + BugType NullDereferenceBugType{this, "Null-smartPtr-deref", + "C++ smart

[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 adergac...@apple.com). Changed prior to commit:

[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

[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:

[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() << " {" <<

[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:

[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/

[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/

[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;

[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 { + ///

  1   2   >