From: Rafael Espindola Date: Fri, 2 Jan 2015 23:23:52 +0000 (+0000) Subject: Also avoid warning on -flto/-fno-lto on linux. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8492cf5ba3bb5ef57e12c037e7655522953b660;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225095 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 93027df9cf..de2afd55ea 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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.