summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMikhail Maltsev <mikhail.maltsev@arm.com>2018-04-20 16:29:03 +0000
committerMikhail Maltsev <mikhail.maltsev@arm.com>2018-04-20 16:29:03 +0000
commit6550c139126ed0a0a6b5fce8f09bde81e60c7abf (patch)
tree3a5e01b1c4a418f9570d87ea3b80d3d8ba46f8cf /clang/lib/Frontend/CompilerInvocation.cpp
parenta417362c28fc695aa9a86807e0a37e0658a7724c (diff)
downloadbcm5719-llvm-6550c139126ed0a0a6b5fce8f09bde81e60c7abf.tar.gz
bcm5719-llvm-6550c139126ed0a0a6b5fce8f09bde81e60c7abf.zip
[CodeGen] Add an option to suppress output of llvm.ident
Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite. Reviewers: faisalv, echristo, aprantl Reviewed By: aprantl Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01 Differential Revision: https://reviews.llvm.org/D45255 llvm-svn: 330442
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 67e15b41add..f904e65e724 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1112,6 +1112,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue(
Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags);
+ Opts.EmitVersionIdentMetadata = Args.hasFlag(OPT_Qy, OPT_Qn, true);
+
return Success;
}
OpenPOWER on IntegriCloud