Flandini wrote:

> Have you considered changing `MemRegion::getMemorySpace()` into 
> `MemRegion::getMemorySpace(ProgramStateRef)`?

I thought about this, but I decided against it since I am thinking that 
MemSpaces will eventually be their own separate thing, not part of the 
MemRegion hierarchy, i.e., MemSpaces will eventually just be a trait thing, 
maybe with its own checker depending on how much functionality can be added 
with this different implementation?

All this being said, I am happy to change the API of how we get memory spaces, 
I am not tied to the current approach/API, just that we can move towards better 
results for https://github.com/llvm/llvm-project/issues/115410.

> (Maybe in some contexts where we currently call `getMemorySpace` we just 
> don't have a State, and can't easily get one - and that would kill this 
> approach.) 

This has been the main thing I'm working through on this PR. This PR doesn't 
totally remove all `getMemorySpace` calls; this PR covers most of the files 
that use memory spaces, but there still remain some spots that are harder for 
me to change right now that I plan to work through. These are in RegionStore 
and ClusterAnalysis which don't take state, MemRegion (including the changes 
that would happen after removing MemSpace from the hierarchy) and all the 
print/dump methods which don't take state, and a dozen spots in 
StackAddrEscapeChecker that don't take state that I couldn't think of an 
immediate way to add state.

This is also related to @Xazax-hun's above question about whether it would be 
possible to make all the changes here at once, do you have thoughts on that 
@steakhal, I think you tried some stuff here?



https://github.com/llvm/llvm-project/pull/123003
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to