Also avoid warning on -flto/-fno-lto on linux.

On OS X a .s file is preprocessed, it is not on linux, which is why the warning was still
showing up on linux but not OS X.

llvm-svn: 225095
This commit is contained in:
Rafael Espindola 2015-01-02 23:23:52 +00:00
parent 2ad2a8b943
commit 16042fc2b9
1 changed files with 7 additions and 2 deletions

View File

@ -3379,8 +3379,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
D.Diag(diag::warn_ignored_gcc_optimization) << (*it)->getAsString(Args);
}
// Don't warn about unused -f(no-)?lto. This can happen when we're preprocessing,
// precompiling or assembling.
// Don't warn about unused -f(no-)?lto. This can happen when we're preprocessing or
// precompiling.
Args.ClaimAllArgs(options::OPT_flto);
Args.ClaimAllArgs(options::OPT_fno_lto);
@ -4810,6 +4810,11 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
// and "clang -emit-llvm -c foo.s"
Args.ClaimAllArgs(options::OPT_emit_llvm);
// Don't warn on -flto/-fno-lto
// FIXME: Code duplicated with Clang::ConstructJob.
Args.ClaimAllArgs(options::OPT_flto);
Args.ClaimAllArgs(options::OPT_fno_lto);
// Invoke ourselves in -cc1as mode.
//
// FIXME: Implement custom jobs for internal actions.