[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-21 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:291 // we can try this function - if (Call.getNumArgs() == 2 && - Call.getDecl()->getDeclContext()->isStdNamespace()) -if (smartptr::isStdSmartPtr(Call.getArgExpr(0)) |

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-21 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 rG80068ca6232b: [analyzer] Fix for faulty namespace test in SmartPtrModelling (authored by RedDocMD). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-21 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. Can we please land the fix? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:291 // we can try this function - if (Call.getNumArgs() == 2 && - Call.getDecl()->getDeclContext()->isStdNamespace()) -if (smartptr::isStdSmartPtr(Call.getArgExpr(0))

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 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. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko accepted this revision. vsavchenko added a comment. Great, LGTM! But let's wait for @xazax.hun anyways Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 __

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 360064. RedDocMD added a comment. Removed unnecessary white space Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtr

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:252 +static bool isStdFunctionCall(const CallEvent &Call) { + return Call.getDecl() && Call.getDecl() ->getDeclContext()->isStdNamespace(); +} vsavchenko wrote: >

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:252 +static bool isStdFunctionCall(const CallEvent &Call) { + return Call.getDecl() && Call.getDecl() ->getDeclContext()->isStdNamespace(); +} nit: there's an ex

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:252-255 + const auto *Decl = Call.getDecl(); + if (!Decl) +return false; + return Decl->getDeclContext()->isStdNamespace(); vsavchenko wrote: > Can we use a

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 360061. RedDocMD added a comment. More refactor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp cla

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:252-255 + const auto *Decl = Call.getDecl(); + if (!Decl) +return false; + return Decl->getDeclContext()->isStdNamespace(); Can we use a one-liner that I s

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 360051. RedDocMD added a comment. Refactored out check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cp

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added a comment. Also, I tested this fix on a set of open-source projects and I don't see any problems. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-20 Thread Valeriy Savchenko via Phabricator via cfe-commits
vsavchenko added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:254-257 + const auto *Decl = Call.getDecl(); + if (!Decl) +return false; + if (!Decl->getDeclContext()->isStdNamespace()) I think you can have a separate f

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-19 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added a comment. Would this test do? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-19 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD updated this revision to Diff 360027. RedDocMD added a comment. Added a simple test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106296/new/ https://reviews.llvm.org/D106296 Files: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-19 Thread Deep Majumder via Phabricator via cfe-commits
RedDocMD added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:275 +return false; + const auto *Decl = Call.getDecl(); + if (!Decl) xazax.hun wrote: > Can we model a function call without a declaration? I wonder if we sho

[PATCH] D106296: [analyzer] Fix for faulty namespace test in SmartPtrModelling

2021-07-19 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun requested changes to this revision. xazax.hun added a comment. This revision now requires changes to proceed. Commented some nits, but overall looks good to me. However, could you include some tests? We usually do not commit any changes without tests unless it is really hard to create