[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 16:11:33 PST 2022


sgatev marked 2 inline comments as done.
sgatev added a comment.

I think we should provide such functionality and it probably should also apply to some of the pointer and reference values. Not sure what the default should be, but having the ability to choose the level of soundness for certain analyses is valuable so I think both options should be possible. We don't have that implemented yet and I think it might be better to consider this together with other improvements that we want to make such as lazy value initialization. Would you be ok with deferring this for now? I noted it with a FIXME in the code.



================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:141
+    // Global vars are already initialized in `Environment`.
+    if (D.hasGlobalStorage())
+      return;
----------------
xazax.hun wrote:
> Do we expect to ever see a global declaration in a transfer function? Or is this for static locals? If it is for the latter, I'd adjust the comment.
It's for static locals. Updated the comment.


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