Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jul 2012 13:12:58 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238864 - head/contrib/llvm/tools/clang/lib/Driver
Message-ID:  <201207281312.q6SDCweE029339@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Jul 28 13:12:57 2012
New Revision: 238864
URL: http://svn.freebsd.org/changeset/base/238864

Log:
  Similar to what is already done for Linux, make clang not complain about
  unused -g, -emit-llvm or -w arguments when doing linking.  E.g. invoking
  "clang -g foo.o -o foo" will now be silent.
  
  Reported by:	Jakub Lach <jakub_lach@mailplus.pl>
  MFC after:	1 week

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp

Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sat Jul 28 12:50:25 2012	(r238863)
+++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Sat Jul 28 13:12:57 2012	(r238864)
@@ -4745,6 +4745,14 @@ void freebsd::Link::ConstructJob(Compila
   const Driver &D = getToolChain().getDriver();
   ArgStringList CmdArgs;
 
+  // Silence warning for "clang -g foo.o -o foo"
+  Args.ClaimAllArgs(options::OPT_g_Group);
+  // and "clang -emit-llvm foo.o -o foo"
+  Args.ClaimAllArgs(options::OPT_emit_llvm);
+  // and for "clang -w foo.o -o foo". Other warning options are already
+  // handled somewhere else.
+  Args.ClaimAllArgs(options::OPT_w);
+
   if (!D.SysRoot.empty())
     CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207281312.q6SDCweE029339>