diff options
author | Usman Nadeem <mnadeem@quicinc.com> | 2021-09-08 12:10:17 -0700 |
---|---|---|
committer | Usman Nadeem <mnadeem@quicinc.com> | 2021-09-08 15:40:32 -0700 |
commit | d2d2e5ea480feb09dc0edeac2eb14310de74b372 (patch) | |
tree | 66376a58c303b7ea0b4457720ba3ae2543a77734 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 4b5e260b1d5b463a3488372bd7df183ae60ef883 (diff) | |
download | llvm-d2d2e5ea480feb09dc0edeac2eb14310de74b372.zip llvm-d2d2e5ea480feb09dc0edeac2eb14310de74b372.tar.gz llvm-d2d2e5ea480feb09dc0edeac2eb14310de74b372.tar.bz2 |
[clang][Driver] Update/cleanup LTO logic to ensure that the last lto argument is honored
- Make flto an alias of flto=full.
- Make foffload-lto an alias of foffload-lto=full.
- Make flto_EQ_jobserver, flto_EQ_auto aliases of flto=full,
since they are being treated as full lto right now.
- Clean up the code for parseLTOMode and setLTOMode.
- Replace uses of OPT_flto with OPT_flto_EQ since they alias now.
Change-Id: Iea5338c20cb800b43529b20745e92600e2cfd2b1
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 014595c..c23740fd 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1419,7 +1419,7 @@ void CompilerInvocation::GenerateCodeGenArgs( } if (Opts.PrepareForLTO && !Opts.PrepareForThinLTO) - GenerateArg(Args, OPT_flto, SA); + GenerateArg(Args, OPT_flto_EQ, "full", SA); if (Opts.PrepareForThinLTO) GenerateArg(Args, OPT_flto_EQ, "thin", SA); @@ -1706,9 +1706,10 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, } } - Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ); + Opts.PrepareForLTO = false; Opts.PrepareForThinLTO = false; if (Arg *A = Args.getLastArg(OPT_flto_EQ)) { + Opts.PrepareForLTO = true; StringRef S = A->getValue(); if (S == "thin") Opts.PrepareForThinLTO = true; |