erichkeane added a comment.

In https://reviews.llvm.org/D40925#1276114, @rnk wrote:

> 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.


I looked into it real quick, and think that checking storage class instead of 
duration is incorrect here.  See https://reviews.llvm.org/D53718 for the fix 
@zturner is asking for (I think!).


Repository:
  rC Clang

https://reviews.llvm.org/D40925



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to