[PATCH] D132142: [analyzer] Prefer wrapping SymbolicRegions by ElementRegions

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 1 04:16:43 PDT 2022


martong added inline comments.


================
Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:799
+  /// we actually know their types.
+  QualType getApproximatedType() const {
+    return sym->getType()->getPointeeType();
----------------
steakhal wrote:
> martong wrote:
> > I think we should express that this returns the
> > 
> > 
> >   - type of the pointee
> >   - the type that is the "static" type, id est, the type of the declaration; `void`, `char` and `base` in your example above.
> > 
> > In this sense, what about `getPointeeStaticType`?
> > 
> > 
> I think it's important to discourage people from using this; hence the `approximated` calls attention that this might always be accurate.
> I'm okay to add the `pointee` somewhere in the name.
> 
> I don't have a strong opinion about this.
Isn't precise enough to say that this returns the `static` type? I don't quite get the exact definition of the "approximation" we do here, so I guess others will not get that either.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132142/new/

https://reviews.llvm.org/D132142



More information about the cfe-commits mailing list