[PATCH] D120149: [clang][dataflow] Add support for global storage values
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 18 13:42:51 PST 2022
sgatev marked an inline comment as done.
sgatev added inline comments.
================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:80
+
+/// Initializes global storage values in sub-expressions of `S`.
+static void initGlobalVars(const Stmt &S, Environment &Env) {
----------------
ymandel wrote:
> maybe clarify that it intializes both declarations that are present *in* the substatements and those referenced *from* the sub statements?
Updated.
================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:305
+
+ auto &Loc = Env.createStorageLocation(*S);
+ if (VarDeclLoc->getType()->isReferenceType()) {
----------------
ymandel wrote:
> should this be in the `else` branch? As is, `Loc` looks unused if the condition is true.
Yeap, moved it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120149/new/
https://reviews.llvm.org/D120149
More information about the cfe-commits
mailing list