[PATCH] D150655: [clang][dataflow] Use `Strict` accessors in more places in Transfer.cpp.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 07:12:42 PDT 2023


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


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:717-723
+    Value *SubExprVal = Env.getValueStrict(*SubExpr);
+    if (SubExprVal == nullptr)
       return;
 
-    Env.setStorageLocation(*S, *SubExprLoc);
+    auto &Loc = Env.createStorageLocation(*S);
+    Env.setStorageLocationStrict(*S, Loc);
+    Env.setValue(Loc, *SubExprVal);
----------------
xazax.hun wrote:
> This operation is basically something like an RValue to LValue cast. I am not sure how many of these will we have, but it might be a good idea to look out if we want to create something like `propagateAsLValue` similar to `propagateValue`.
I'll keep an eye out for this, but it's plausible to me that "materialize temporary" is the only operation of this kind. ("Materialize temporary" essentially means "rvalue to lvalue", if you think about it.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150655



More information about the cfe-commits mailing list