From 31b23549295ad79443f2d34d187f66756ca564d0 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Thu, 15 Oct 2015 13:08:13 +0000 Subject: 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 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 4220487..61144fc 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); -- cgit v1.1