[PATCH] D153960: [clang][dataflow] Implement support for pointers to members.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 06:26:50 PDT 2023


mboehme marked an inline comment as done.
mboehme added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:236
+    // `DeclRefExpr`s to fields and non-static methods aren't glvalues, and
+    // there's also no sensible `Value` we can assign to them, so skip them.
+    if (isa<FieldDecl>(VD))
----------------
sammccall wrote:
> I'm a bit confused by this. Why bail out rather than create the storage location?
> 
> `C::x` is going to be part of `&C::x`, and we're going to create the storagelocation by calling getStorageLocation() on line 456. So why not do it already?
We can't associate a storage location with `*S` because it's not a glvalue, and only glvalues are allowed to be associated with storage locations. So we have to defer this work until we get to the `&` operator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153960



More information about the cfe-commits mailing list