[PATCH] D77229: [Analyzer][WIP] Avoid handling of LazyCompundVals in IteratorModeling

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 07:27:41 PDT 2020


NoQ added a comment.

Aha, ok, sounds like i thought that it's not worth it to inline the constructor for an argument when the call itself is not inlined, therefore i didn't model the construction context for this call. See also D49443#1193290 <https://reviews.llvm.org/D49443#1193290>. Your example shows that i was wrong to give up and this is something we should totally implement.

The proper solution is to model the target region in `ExprEngine` as a parameter region based on the `ParmVarDecl` that //would have been used if the function was inlined//, instead of the dummy temporary. Then it'll be kept alive as an object under construction.

The most annoying part is to make sure that you're using the same `FunctionDecl` consistently everywhere. If this turns out to be too annoying, we could also replace `VarRegion{ParmVarDecl}` with a new sort of region that doesn't include a specific `ParmVarDecl` but merely a parameter index (and maybe a type or a call site expr), so that not to bother with redeclarations; this is the right thing to do anyway.


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

https://reviews.llvm.org/D77229





More information about the cfe-commits mailing list