diff options
author | Teresa Johnson <tejohnson@google.com> | 2015-10-15 13:08:13 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2015-10-15 13:08:13 +0000 |
commit | 31b23549295ad79443f2d34d187f66756ca564d0 (patch) | |
tree | fb1ff4eda7f7a9e9e966ae156001833e69e9bb60 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | cbd42b17c7853bc3258d5467d8f50879541c3888 (diff) | |
download | bcm5719-llvm-31b23549295ad79443f2d34d187f66756ca564d0.tar.gz bcm5719-llvm-31b23549295ad79443f2d34d187f66756ca564d0.zip |
Clang support for -flto=thin.
Summary:
Add clang support for -flto=thin option, which is used to set the
EmitFunctionSummary code gen option on compiles.
Add -flto=full as an alias to the existing -flto.
Add tests to check for proper overriding of -flto variants on the
command line, and convert grep tests to FileCheck.
Reviewers: dexonsmith, joker.eph
Subscribers: davidxl, cfe-commits
Differential Revision: http://reviews.llvm.org/D11908
llvm-svn: 250398
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 4220487e4d8..61144fc558b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -499,7 +499,9 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.MergeFunctions = Args.hasArg(OPT_fmerge_functions); - Opts.PrepareForLTO = Args.hasArg(OPT_flto); + Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ); + const Arg *A = Args.getLastArg(OPT_flto, OPT_flto_EQ); + Opts.EmitFunctionSummary = A && A->containsValue("thin"); Opts.MSVolatile = Args.hasArg(OPT_fms_volatile); |