Currently clang does not emit unused static constants. GCC emits these constants by default when there is no optimization.
GCC 's option -fkeep-static-consts seems to be buggy. I am not sure what exactly it does because default behavior emits unused static constants (i.e. without the use of any option) and this option does not work with optimization. Its negation can be used to not emit the static constants.
In Clang, since default behavior does not keep unused static constants, I implemented -fkeep-static-consts to emit these if required. This could be useful for producing identification strings like SVN identifiers inside the object file even though the string isn't used by the program.
Let's make this a CodeGenOption, since only CodeGen needs to look at it.