[PATCH] D130600: [clang][dataflow] Handle return statements
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 4 08:55:21 PDT 2022
sgatev accepted this revision.
sgatev added inline comments.
================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:208
Environment Env(*this);
+ Env.ReturnLoc = Env.getStorageLocation(*Call, SkipPast::Reference);
----------------
Let's add a FIXME to support references here.
================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:543-545
+ auto &ReturnLoc = Env.createStorageLocation(*S);
+ Env.setStorageLocation(*S, ReturnLoc);
auto CalleeEnv = Env.pushCall(S);
----------------
Now there's a hidden connection - `ReturnLoc` gets assigned a value in `Env` because we implicitly use the same storage location in `Env.pushCall(S)`. I suggest adding a comment about this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130600/new/
https://reviews.llvm.org/D130600
More information about the cfe-commits
mailing list