Forward -C and -CC to clang.
- <rdar://problem/6945384> Driver should pass down -C and -CC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73087 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index f5b017c..bfc247a 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -43,8 +43,17 @@
ArgStringList &CmdArgs,
const InputInfo &Output,
const InputInfoList &Inputs) const {
- // Handle dependency file generation.
Arg *A;
+
+ if ((A = Args.getLastArg(options::OPT_C)) ||
+ (A = Args.getLastArg(options::OPT_CC))) {
+ if (!Args.hasArg(options::OPT_E))
+ D.Diag(clang::diag::err_drv_argument_only_allowed_with)
+ << A->getAsString(Args) << "-E";
+ A->render(Args, CmdArgs);
+ }
+
+ // Handle dependency file generation.
if ((A = Args.getLastArg(options::OPT_M)) ||
(A = Args.getLastArg(options::OPT_MM)) ||
(A = Args.getLastArg(options::OPT_MD)) ||