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)) |
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
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
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))
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
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
__
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
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:
>
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
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
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
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
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
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
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
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
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
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
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
19 matches
Mail list logo