Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
need to do anything special to support this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68403 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 6d19f1a..69cb85b 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -140,6 +140,15 @@
}
}
+void ArgList::ClaimAllArgs(options::ID Id0) const {
+ // FIXME: Make fast.
+ for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
+ const Arg *A = *it;
+ if (A->getOption().matches(Id0))
+ A->claim();
+ }
+}
+
//
InputArgList::InputArgList(const char **ArgBegin, const char **ArgEnd)
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 1667743..70daaf5 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -415,6 +415,14 @@
Args.MakeArgString(getToolChain().GetProgramPath(C, "clang-cc").c_str());
Dest.addCommand(new Command(Exec, CmdArgs));
+ // Claim some arguments which clang supports automatically.
+
+ // -fpch-preprocess is used with gcc to add a special marker in the
+ // -output to include the PCH file. Clang's PTH solution is
+ // -completely transparent, so we do not need to deal with it at
+ // -all.
+ Args.ClaimAllArgs(options::OPT_fpch_preprocess);
+
// Claim some arguments which clang doesn't support, but we don't
// care to warn the user about.