summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-07-21 23:40:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-07-21 23:40:37 +0000
commita7431924ab93881d34914159b1628010cb7c0a5d (patch)
tree5ea26e35cfcc8ee03b11f79a31de6dd2c24b7a87 /clang/lib/Driver/Tools.cpp
parent0491270f999f32651d50dd1b79fd973d8e01509d (diff)
downloadbcm5719-llvm-a7431924ab93881d34914159b1628010cb7c0a5d.tar.gz
bcm5719-llvm-a7431924ab93881d34914159b1628010cb7c0a5d.zip
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. llvm-svn: 135723
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index c54ced2d1d0..2fb865e0207 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1459,6 +1459,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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)) {
OpenPOWER on IntegriCloud