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

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 04:47:17 PDT 2020


baloghadamsoftware added a comment.

I spent some time on thinking about this during the weekend. It is no wonder that the tests fail. It seems that many parts of the Analyzer core exploit the fact that the `MemRegion`s of parameters are `VarRegion`s.  This is no wonder because all `ParamVarDecl` are `VarDecl` and in an inlined function parameters behave like variables. This is the correct behavior which I think should not be changed. Even if I put weeks or months of work into it the code will be worse at the end because there will be lots of branches upon the nature of the variable and alternative ways for reaching the `Decl` from their regions. This is not the proper way, `MemRegion`s for parameters in inlined functions should remain `VarRegion`s because parameters **are** variables inside. On the other hand, from outside it does not matter what kind of regions they are. We mainly need the region there to use it as key for `GDM` maps. That is why `ParamRegion`s should only be created for functions that are not inlined. If they have no definition then they cannot be inlined so a `ParamRegion` is OK for them. However, if they have a definition then there is no problem finding the same `Decl` because the definition is that same `Decl` that we use everywhere so it can and should remain a `VarRegion`.


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

https://reviews.llvm.org/D77229





More information about the cfe-commits mailing list