[PATCH] D150221: Add option -fkeep-persistent-storage-variables to emit all variables that have a persistent storage duration

Zheng Qian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 4 14:13:25 PDT 2023


qianzhen added inline comments.


================
Comment at: clang/test/CodeGen/keep-persistent-storage-variables.cpp:32-39
+int test1() {
+  g1 = 3;
+  return g1;
+}
+
+int test2() {
+  return g2;
----------------
hubert.reinterpretcast wrote:
> Why add functions that use `g1` and `g2`? Is there some reason to suspect that using the variables will cause them not to be emitted as explicitly used?
> 
> If removing these functions, please also remove `g3` and `g4` as redundant.
Right, I don't think using the variables in a function will cause then not to be emitted as explicitly used. Patch updated accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150221



More information about the cfe-commits mailing list