[cfe-commits] r135723 - /cfe/trunk/lib/Driver/Tools.cpp

Rafael Espindola rafael.espindola at gmail.com
Thu Jul 21 16:40:37 PDT 2011


Author: rafael
Date: Thu Jul 21 18:40:37 2011
New Revision: 135723

URL: http://llvm.org/viewvc/llvm-project?rev=135723&view=rev
Log:
Avoid warning on "clang -c -Dfoo test.i". Lines like these are created
when using ccache and libtool.m4 assumes that the compiler cannot print
warnings about options it knows about.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=135723&r1=135722&r2=135723&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jul 21 18:40:37 2011
@@ -1459,6 +1459,12 @@
   if (types::getPreprocessedType(InputType) != types::TY_INVALID)
     AddPreprocessingOptions(D, Args, CmdArgs, Output, Inputs);
 
+  // Don't warn about "clang -c -DPIC -fPIC test.i" because libtool.m4 assumes
+  // that "The compiler can only warn and ignore the option if not recognized".
+  // When building with ccache, it will pass -D options to clang even on
+  // preprocessed inputs and configure concludes that -fPIC is not supported.
+  Args.ClaimAllArgs(options::OPT_D);
+
   // Manually translate -O to -O2 and -O4 to -O3; let clang reject
   // others.
   if (Arg *A = Args.getLastArg(options::OPT_O_Group)) {





More information about the cfe-commits mailing list