[clang] [clang][dataflow] Handle CXXInheritedCtorInitExpr in ResultObjectVisitor. (PR #99616)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 29 03:16:24 PDT 2024


martinboehme wrote:

> I have a high-level question not directly related to the patch. We have probably even talked about it at a conference a few years ago but I don't remember 😅

I don't recall -- maybe you talked to someone else?

> > `ResultObjectVisitor`
> 
> I briefly looked at the implementation and I suspect that you folks might be reinventing [`ConstructionContext`](https://clang.llvm.org/doxygen/classclang_1_1ConstructionContext.html) which is typically¹ already available in the CFG. (Under an off-by-default CFG build option.) (I'm in favor of turning it on by default.) (Together with a few other options that improve precision, eg. copy elision and RVO support.)
> 
> __ ¹ Not all of the 30+ possible construction contexts are currently implemented. But your visitor doesn't seem to implement them either.

Thanks for the info -- I wasn't aware of `ConstructionContext`. Will take a look. Can you point me to some examples of how this is used?

Agree that we should use `ConstructionContext` in favor of `ResultObjectVisitor` if feasible.

https://github.com/llvm/llvm-project/pull/99616


More information about the cfe-commits mailing list