Pass down the -flto option to the -cc1 job, and from there into the

CodeGenOptions and onto the PassManagerBuilder. This enables gating
the new EliminateAvailableExternally module pass on whether we are
preparing for LTO.

If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not
included as we want to preserve available externally functions for possible
link time inlining.

llvm-svn: 239481
This commit is contained in:
Teresa Johnson
2015-06-10 17:49:45 +00:00
parent 232fa9af3b
commit 88c3c67997
6 changed files with 20 additions and 1 deletions

View File

@@ -485,6 +485,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.MergeFunctions = Args.hasArg(OPT_fmerge_functions);
Opts.PrepareForLTO = Args.hasArg(OPT_flto);
Opts.MSVolatile = Args.hasArg(OPT_fms_volatile);
Opts.VectorizeBB = Args.hasArg(OPT_vectorize_slp_aggressive);