[clang] [clang][dataflow] Treat comma operator correctly in `getResultObjectLocation()`. (PR #78427)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 17:11:33 PST 2024


https://github.com/Xazax-hun approved this pull request.

This change itself looks good to me, but I start to doubt whether we actually need `getResultObjectLocation` the way it is currently implemented. One of the red flags for me seeing some `getResultObjectLocation` calls in `UncheckedOptionalAccessModel.cpp`. I think most (all?) of those calls are redundant, the type of the expression already guarantees that we have the right location. Moreover, I think the propagation should happen internally in the built-in transfers, so authors of user code like `UncheckedOptionalAccessModel` should never need to think about these implementation details. 

I think it might make sense to review all of the calls and after we removed the redundant ones, we might want to reconsider if it makes sense to restrict the use of this function somewhat.

Let me know if I am missing something.

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


More information about the cfe-commits mailing list