[clang] [nfc][analyzer] Add MemSpace trait to program state (PR #123003)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 17 05:17:30 PST 2025
NagyDonat wrote:
@Xazax-hun
When you write that this commit "makes memspaces a bit more error prone to use. Do you think we could find a way to prevent using isa on memspaces?" do I understand it correctly you mean that it's error-prone to use `isa<...>(MR->getMemorySpace())` directly? This expression is indeed error-prone, but the problem is not the use of `isa` but the use of the method `getMemorySpace()` which will sometimes return incorrect (not the most accurate) data after this commit.
I think and hope that this error-prone situation will be resolved soon in a follow-up commit that completely transfers the handling of memory spaces to the state trait, because after that point `MemRegion` won't have an internal not entirely accurate reference to its memory space and all memory space lookups would look like `getMemSpace(MR, State)` (and it will be fine to call `isa` on this function).
https://github.com/llvm/llvm-project/pull/123003
More information about the cfe-commits
mailing list