Driver: Add an explicit argument translation phase to the driver itself. We are going to need this to handle things like -Xassembler, -Xpreprocessor, and -Xlinker which we might have to introspect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105842 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 92c7d79..ba329e3 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -388,9 +388,9 @@
   }
 }
 
-DerivedArgList *Darwin::TranslateArgs(InputArgList &Args,
+DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
                                       const char *BoundArch) const {
-  DerivedArgList *DAL = new DerivedArgList(Args, false);
+  DerivedArgList *DAL = new DerivedArgList(Args.getBaseArgs());
   const OptTable &Opts = getDriver().getOpts();
 
   // FIXME: We really want to get out of the tool chain level argument
@@ -478,7 +478,8 @@
   }
   setTarget(iPhoneVersion, Major, Minor, Micro);
 
-  for (ArgList::iterator it = Args.begin(), ie = Args.end(); it != ie; ++it) {
+  for (ArgList::const_iterator it = Args.begin(),
+         ie = Args.end(); it != ie; ++it) {
     Arg *A = *it;
 
     if (A->getOption().matches(options::OPT_Xarch__)) {
@@ -764,12 +765,6 @@
   return 0;
 }
 
-DerivedArgList *Generic_GCC::TranslateArgs(InputArgList &Args,
-                                           const char *BoundArch) const {
-  return new DerivedArgList(Args, true);
-}
-
-
 /// TCEToolChain - A tool chain using the llvm bitcode tools to perform
 /// all subcommands. See http://tce.cs.tut.fi for our peculiar target.
 /// Currently does not support anything else but compilation.
@@ -824,11 +819,6 @@
   return *T;
 }
 
-DerivedArgList *TCEToolChain::TranslateArgs(InputArgList &Args,
-                                            const char *BoundArch) const {
-  return new DerivedArgList(Args, true);
-}
-
 /// OpenBSD - OpenBSD tool chain which can call as(1) and ld(1) directly.
 
 OpenBSD::OpenBSD(const HostInfo &Host, const llvm::Triple& Triple)