aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorzhizhouy <zhizhouy@google.com>2020-03-31 10:23:17 -0700
committerzhizhouy <zhizhouy@google.com>2020-03-31 10:31:31 -0700
commit94d912296de21e965198ba1ddd1ca6714b3e4722 (patch)
treecb7c00c1f45054a21f7cbbeb93a575c82d1ecaad /clang/lib/Frontend/CompilerInvocation.cpp
parent4799a1745b300710c800e4bfa55c6bb630edd58c (diff)
downloadllvm-94d912296de21e965198ba1ddd1ca6714b3e4722.zip
llvm-94d912296de21e965198ba1ddd1ca6714b3e4722.tar.gz
llvm-94d912296de21e965198ba1ddd1ca6714b3e4722.tar.bz2
[NFC] Do not run CGProfilePass when not using integrated assembler
Summary: CGProfilePass is run by default in certain new pass manager optimization pipeline. Assemblers other than llvm as (such as gnu as) cannot recognize the .cgprofile entries generated and emitted from this pass, causing build time error. This patch adds new options in clang CodeGenOpts and PassBuilder options so that we can turn cgprofile off when not using integrated assembler. Reviewers: Bigcheese, xur, george.burgess.iv, chandlerc, manojgupta Reviewed By: manojgupta Subscribers: manojgupta, void, hiraditya, dexonsmith, llvm-commits, tcwang, llozano Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62627
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dc5e932..46ba46d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -823,6 +823,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.RerollLoops = Args.hasArg(OPT_freroll_loops);
Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as);
+ Opts.CallGraphProfile = !Opts.DisableIntegratedAS;
Opts.Autolink = !Args.hasArg(OPT_fno_autolink);
Opts.SampleProfileFile =
std::string(Args.getLastArgValue(OPT_fprofile_sample_use_EQ));