]> granicus.if.org Git - clang/commit
Currently clang does not emit unused static constants. GCC emits these
authorElizabeth Andrews <elizabeth.andrews@intel.com>
Wed, 22 Aug 2018 19:05:19 +0000 (19:05 +0000)
committerElizabeth Andrews <elizabeth.andrews@intel.com>
Wed, 22 Aug 2018 19:05:19 +0000 (19:05 +0000)
commit6a00520d81d71f6c1df16288cf7f65b8ab9ac124
tree8b6c00e22ba3981522e148a16c831881cd33da12
parent6b133f8fc61e264ac6cf8ffd5d214ded1b8ae57b
Currently clang does not emit unused static constants. GCC emits these
constants by default when there is no optimization.

GCC's option -fno-keep-static-consts can be used to not emit
unused static constants.

In Clang, since default behavior does not keep unused static constants,
-fkeep-static-consts can be used 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.

Differential Revision: https://reviews.llvm.org/D40925

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340439 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.def
lib/CodeGen/CodeGenModule.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/keep-static-consts.cpp [new file with mode: 0644]