ymandel accepted this revision. ymandel added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:74-77 + auto *V = dyn_cast<VarDecl>(&D); + if (V == nullptr) + return; + initGlobalVar(*V, Env); ---------------- ================ 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) { ---------------- maybe clarify that it intializes both declarations that are present *in* the substatements and those referenced *from* the sub statements? ================ Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:140 + + // Global vars are initialized in `Environment`. + if (D.hasGlobalStorage()) ---------------- ================ Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:305 + + auto &Loc = Env.createStorageLocation(*S); + if (VarDeclLoc->getType()->isReferenceType()) { ---------------- should this be in the `else` branch? As is, `Loc` looks unused if the condition is true. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120149/new/ https://reviews.llvm.org/D120149 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits