[PATCH] D103750: [analyzer][WIP] Handle std::make_unique for SmartPtrModeling

Deep Majumder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 7 11:52:30 PDT 2021


RedDocMD added a comment.

In D103750#2803499 <https://reviews.llvm.org/D103750#2803499>, @NoQ wrote:

> Ugh, this entire `checkBind` hack was so unexpected that I didn't even recognize `evalCall`. What prevents you from doing everything in `evalCall`? No state traits, no nothing, just directly take the this-region and attach the value to it?

Because in `evalCall`, I don't have access to the `ThisRegion`. At least I think I don't.
So we have a statement like `auto a = std::make_unique<int>(100)`. In `evalCall` I get a `CallEvent` corresponding to `std::make_unique<int>(100)`. Using `Call.getOriginExpr()` I can get the LHS. But that's only the `Expr`, not the `MemRegion`.  Unlike in a regular constructor call or method call, where `ThisRegion` can easily be obtained from the `Call`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103750/new/

https://reviews.llvm.org/D103750



More information about the cfe-commits mailing list