[cfe-commits] r68403 - in /cfe/trunk: include/clang/Driver/ArgList.h include/clang/Driver/Options.def lib/Driver/ArgList.cpp lib/Driver/Tools.cpp
Daniel Dunbar
daniel at zuster.org
Fri Apr 3 13:51:32 PDT 2009
Author: ddunbar
Date: Fri Apr 3 15:51:31 2009
New Revision: 68403
URL: http://llvm.org/viewvc/llvm-project?rev=68403&view=rev
Log:
Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
need to do anything special to support this.
Modified:
cfe/trunk/include/clang/Driver/ArgList.h
cfe/trunk/include/clang/Driver/Options.def
cfe/trunk/lib/Driver/ArgList.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Driver/ArgList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ArgList.h?rev=68403&r1=68402&r2=68403&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ArgList.h (original)
+++ cfe/trunk/include/clang/Driver/ArgList.h Fri Apr 3 15:51:31 2009
@@ -116,6 +116,10 @@
void AddAllArgsTranslated(ArgStringList &Output, options::ID Id0,
const char *Translation) const;
+ /// ClaimAllArgs - Claim all arguments which match the given
+ /// option id.
+ void ClaimAllArgs(options::ID Id0) const;
+
/// @}
/// @name Arg Synthesis
/// @{
Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=68403&r1=68402&r2=68403&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Fri Apr 3 15:51:31 2009
@@ -454,6 +454,7 @@
OPTION("-force_flat_namespace", force__flat__namespace, Flag, INVALID, INVALID, "", 0, 0, 0)
OPTION("-foutput-class-dir=", foutput_class_dir_EQ, Joined, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fpascal-strings", fpascal_strings, Flag, clang_f_Group, INVALID, "", 0, 0, 0)
+OPTION("-fpch-preprocess", fpch_preprocess, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fpic", fpic, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fpie", fpie, Flag, f_Group, INVALID, "", 0, 0, 0)
OPTION("-fprint-source-range-info", fprint_source_range_info, Flag, clang_f_Group, INVALID, "", 0, 0, 0)
Modified: cfe/trunk/lib/Driver/ArgList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ArgList.cpp?rev=68403&r1=68402&r2=68403&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ArgList.cpp (original)
+++ cfe/trunk/lib/Driver/ArgList.cpp Fri Apr 3 15:51:31 2009
@@ -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)
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=68403&r1=68402&r2=68403&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr 3 15:51:31 2009
@@ -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.
More information about the cfe-commits
mailing list