summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorElizabeth Andrews <elizabeth.andrews@intel.com>2018-08-22 19:05:19 +0000
committerElizabeth Andrews <elizabeth.andrews@intel.com>2018-08-22 19:05:19 +0000
commit6a00520d81d71f6c1df16288cf7f65b8ab9ac124 (patch)
tree8b6c00e22ba3981522e148a16c831881cd33da12 /lib/Frontend/CompilerInvocation.cpp
parent6b133f8fc61e264ac6cf8ffd5d214ded1b8ae57b (diff)
downloadclang-6a00520d81d71f6c1df16288cf7f65b8ab9ac124.tar.gz
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
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 8e836b163e..78ed8f7820 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/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;
}