diff options
author | Elizabeth Andrews <elizabeth.andrews@intel.com> | 2018-08-22 19:05:19 +0000 |
---|---|---|
committer | Elizabeth Andrews <elizabeth.andrews@intel.com> | 2018-08-22 19:05:19 +0000 |
commit | 6593df241a1d119c84c0d97eec4486d2756c4ea1 (patch) | |
tree | b1d997c87f625efb40506492feb4bafb29aab48d /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | bc6d8970bb6ec44e1a0c8015a803fa382953dfa4 (diff) | |
download | bcm5719-llvm-6593df241a1d119c84c0d97eec4486d2756c4ea1.tar.gz bcm5719-llvm-6593df241a1d119c84c0d97eec4486d2756c4ea1.zip |
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
llvm-svn: 340439
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8e836b163ef..78ed8f78207 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1145,6 +1145,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, << A->getAsString(Args) << A->getValue(); } + Opts.KeepStaticConsts = Args.hasArg(OPT_fkeep_static_consts); + return Success; } |