[PATCH] D110625: [analyzer] canonicalize special case of structure/pointer deref
Balázs Benics via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 1 03:44:34 PDT 2021
steakhal added a comment.
In D110625#3035974 <https://reviews.llvm.org/D110625#3035974>, @ASDenysPetrov wrote:
> In D110625#3035929 <https://reviews.llvm.org/D110625#3035929>, @steakhal wrote:
>
>> I thought that `SVal::getType` should return an already canonical `QualType`. If it doesn't do that we would need to do canonicalization at each callsite, which is less than ideal IMO.
>> If it's not yet canonical, we should probably canonicalize within the `getType()` function probably. WDYT?
>
> I believe that it returns non-canonical type. Yes, we shall get canonical versions separately for most cases in practice. This is not ideal but it would be worse to return canonical types at once along with loss of extra information.
Okay, if this is the case, we will need to use `getCanonicalType()` on both `BT` and `elementType`.
Vince, could you update your change, just to make sure it will work in the future, even if the test doesn't show much difference with the current behavior?
Note that you cannot call `getCanonicalType()` on a null-type.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110625/new/
https://reviews.llvm.org/D110625
More information about the cfe-commits
mailing list