[cfe-commits] r68553 - in /cfe/trunk: include/clang/Driver/Options.def lib/Driver/Tools.cpp
Daniel Dunbar
daniel at zuster.org
Tue Apr 7 14:42:00 PDT 2009
Author: ddunbar
Date: Tue Apr 7 16:42:00 2009
New Revision: 68553
URL: http://llvm.org/viewvc/llvm-project?rev=68553&view=rev
Log:
Driver: Only forward last instance of -mmacosx-version-min= and
-isysroot to clang.
- Don't forward arbitrary -i* options to clang, just the ones we know
about.
Modified:
cfe/trunk/include/clang/Driver/Options.def
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=68553&r1=68552&r2=68553&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Tue Apr 7 16:42:00 2009
@@ -108,6 +108,7 @@
OPTION("<clang f group>", clang_f_Group, Group, f_Group, INVALID, "", 0, 0, 0)
OPTION("<g group>", g_Group, Group, INVALID, INVALID, "", 0, 0, 0)
OPTION("<i group>", i_Group, Group, INVALID, INVALID, "", 0, 0, 0)
+OPTION("<clang i group>", clang_i_Group, Group, i_Group, INVALID, "", 0, 0, 0)
OPTION("<m group>", m_Group, Group, INVALID, INVALID, "", 0, 0, 0)
OPTION("<u group>", u_Group, Group, INVALID, INVALID, "", 0, 0, 0)
@@ -518,18 +519,18 @@
OPTION("-g", g_Flag, Flag, g_Group, INVALID, "", 0, 0, 0)
OPTION("-g", g_Joined, Joined, g_Group, INVALID, "", 0, 0, 0)
OPTION("-headerpad_max_install_names", headerpad__max__install__names, Joined, INVALID, INVALID, "", 0, 0, 0)
-OPTION("-idirafter", idirafter, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
+OPTION("-idirafter", idirafter, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
OPTION("-imacros", imacros, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
OPTION("-image_base", image__base, Separate, INVALID, INVALID, "", 0, 0, 0)
-OPTION("-include", include, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
+OPTION("-include", include, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
OPTION("-init", init, Separate, INVALID, INVALID, "", 0, 0, 0)
OPTION("-install_name", install__name, Separate, INVALID, INVALID, "", 0, 0, 0)
-OPTION("-iprefix", iprefix, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
-OPTION("-iquote", iquote, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
+OPTION("-iprefix", iprefix, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
+OPTION("-iquote", iquote, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
OPTION("-isysroot", isysroot, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
-OPTION("-isystem", isystem, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
-OPTION("-iwithprefixbefore", iwithprefixbefore, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
-OPTION("-iwithprefix", iwithprefix, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
+OPTION("-isystem", isystem, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
+OPTION("-iwithprefixbefore", iwithprefixbefore, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
+OPTION("-iwithprefix", iwithprefix, JoinedOrSeparate, clang_i_Group, INVALID, "", 0, 0, 0)
OPTION("-iwithsysroot", iwithsysroot, JoinedOrSeparate, i_Group, INVALID, "", 0, 0, 0)
OPTION("-i", i, Joined, i_Group, INVALID, "", 0, 0, 0)
OPTION("-keep_private_externs", keep__private__externs, Flag, INVALID, INVALID, "", 0, 0, 0)
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=68553&r1=68552&r2=68553&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Apr 7 16:42:00 2009
@@ -287,7 +287,7 @@
Args.AddAllArgs(CmdArgs, options::OPT_D, options::OPT_U);
Args.AddAllArgs(CmdArgs, options::OPT_I_Group, options::OPT_F);
Args.AddLastArg(CmdArgs, options::OPT_P);
- Args.AddAllArgs(CmdArgs, options::OPT_mmacosx_version_min_EQ);
+ Args.AddLastArg(CmdArgs, options::OPT_mmacosx_version_min_EQ);
// Special case debug options to only pass -g to clang. This is
// wrong.
@@ -296,7 +296,8 @@
Args.AddLastArg(CmdArgs, options::OPT_nostdinc);
- // FIXME: Clang isn't going to accept just anything here.
+ Args.AddLastArg(CmdArgs, options::OPT_isysroot);
+
// FIXME: Use iterator.
// Add -i* options, and automatically translate to -include-pth for
@@ -306,7 +307,7 @@
for (ArgList::const_iterator
it = Args.begin(), ie = Args.end(); it != ie; ++it) {
const Arg *A = *it;
- if (!A->getOption().matches(options::OPT_i_Group))
+ if (!A->getOption().matches(options::OPT_clang_i_Group))
continue;
if (A->getOption().matches(options::OPT_include)) {
More information about the cfe-commits
mailing list