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

2021-07-15 Thread Deep Majumder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG48688257c52d: [analyzer] Model comparision methods of std::unique_ptr (authored by RedDocMD). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ http

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

2021-07-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. The latest version looks good to me, let's land this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D

[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] D104616: [analyzer] Model comparision methods of std::unique_ptr

2021-07-05 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun requested changes to this revision. xazax.hun added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:350 +QualType Type = getInnerPointerType(C, E->getType()->getAsCXXRecordDecl()); +

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

2021-07-04 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. If everybody's happy let's commit :) Comment at: clang/test/Analysis/smart-ptr.cpp:467 + +void uniquePtrComparision(std::unique_ptr unknownPtr) { + auto ptr = std::unique_ptr(new int(13)); Comment at: clang/test/Analysi

[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] 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-03 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ accepted this revision. NoQ added a comment. This revision is now accepted and ready to land. F17741480: 704.jpg I only have a few nits left. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:35 #include +#include

[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-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 Artem Dergachev via Phabricator via cfe-commits
NoQ added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:431 + State, BOK, FirstPtrVal, SecondPtrVal, Call.getResultType()); + State = State->BindExpr(Call.getOriginExpr(), C.getLocationContext(), RetVal); + Now that we

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

2021-07-02 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:408 + auto makeSValFor = [&C, &State, this](const Expr *E, SVal S) -> SVal { +if (S.isZeroConstant()) { + return C.getSValBuilder().makeZeroVal(E->getType()); ---

[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-06-30 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ 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.getLocation

[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-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-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-29 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ added a comment. I suspect that you might want to include `OperationKinds.def` instead of `OperationKinds.h`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104616/new/ https://reviews.llvm.org/D104616 _

[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