[PATCH] D117123: [clang][dataflow] Add transfer functions for initializers

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 12 11:09:44 PST 2022


ymandel accepted this revision.
ymandel added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:171
+
+    Value *InitExprVal = Env.getValue(*InitExpr, SkipPast::None);
+    if (InitExprVal == nullptr)
----------------
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;
};
```


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