[PATCH] D40925: Add option -fkeep-static-consts

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 25 10:46:39 PDT 2018


rnk added a subscriber: zturner.
rnk added a comment.

My coworker, @zturner, asked if I knew a way to force emit all constants, and I mentioned this flag, but we noticed it doesn't work on cases when the constant is implicitly static, like this:

  const int foo = 42;

If I add `static` to it, it gets emitted with -fkeep-static-consts, but as is, it doesn't get emitted.

Do you think it's worth extending the logic to handle this case? GCC seems to that global `foo` regardless of the flag setting.


Repository:
  rC Clang

https://reviews.llvm.org/D40925





More information about the cfe-commits mailing list