[PATCH] D117123: [clang][dataflow] Add transfer functions for initializers
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 12 13:34:55 PST 2022
sgatev marked an inline comment as done.
sgatev added inline comments.
================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:171
+
+ Value *InitExprVal = Env.getValue(*InitExpr, SkipPast::None);
+ if (InitExprVal == nullptr)
----------------
ymandel wrote:
> why `None`? Is the idea that if the expression generates a reference, we want to get the pointer value, not the pointee?
> So, in the example below, the value set for field `y` will (correctly) be the same pointer stored in field `x`?
> ```
> struct A {
> int &x;
> int &y = x;
> };
> ```
Right, `y` gets assigned the same `ReferenceValue` as `x` in this case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117123/new/
https://reviews.llvm.org/D117123
More information about the cfe-commits
mailing list